---
title: "Like a Contractor"
method: POST
path: "/liked-contractors"
tags: ["LikedContractors"]
---

# Like a Contractor

`POST /liked-contractors`

## Request

- Base URL: `https://api.purplegrain.com/api/v1`
- URL: `https://api.purplegrain.com/api/v1/liked-contractors`
- Auth: HTTP bearer

Like a contractor (User or Organization). The owner is the current user;
an Organization owner is accepted when the caller can edit that
organization. One like per (owner, contractor) pair.

## Query parameters

- `include` string

## Request body

- LikedContractorCreateModelAttributes: Flat attributes-adapter request body (Content-Type application/json). Attribute fields and relationships live directly under `data` (no nested `attributes` / `relationships` envelopes). Each relationship is a resource identifier object ({ id, type }). Equivalent JSON:API (nested) shape: `LikedContractorCreateModel` sent as application/vnd.api+json.
  - `data` object, required
    - `contractor` object, nullable, required
      - `id` string, nullable
      - `type` 'user' | 'organization', nullable
    - `owner` object: The owner (contractor) who liked this contractor — a User or an Organization the caller can edit. Defaults to the current user when omitted.
      - `id` string
      - `type` 'user' | 'organization'

## Response `201`

Created

- LikedContractorsShowResponseAttributes: Single liked contractor response for Accept application/json (attributes adapter).
  - `data` LikedContractorModelAttributes: Single liked contractor in attributes-adapter shape (Accept application/json). id, type, and attribute fields at top level; no nested attributes/relationships. The owner/contractor relationship keys may appear when include is used.
    - `id` string
    - `type` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `owner` object: Present when include=owner
    - `contractor` object: Present when include=contractor
  - `meta` PaginationMeta
    - `current_page` number
    - `next_page` number, nullable
    - `prev_page` number, nullable

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Unprocessable Entity (duplicate like, or liking yourself)

---

[API](https://skmtc.dev/purplegrain/apis/purple-grain-api.md) · [All operations](https://skmtc.dev/purplegrain/apis/purple-grain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/purplegrain/apis/purple-grain-api/revisions/29c5c990d66e?raw)
