Hatchmate Core API

Crow social attribution — projects, posts and UTM share links (SA-).


List Crow projects (E29)

GET
https://api.hatchmate.nz
/v1/social/projects
Bearer (JWT)

Live projects of the acting customer, ordered created_at ASC (SA-15).

List Crow projects (E29) › query Parameters

cursor
​string

Opaque base64url keyset cursor over (created_at, id) descending. A cursor that does not decode is 422 (API-39, API-40).

limit
​integer · min: 1 · max: 200

Page size. A value above the maximum is 422, never a silent clamp (API-38).

Default: 50

List Crow projects (E29) › Responses

A page of projects.

​CrowProject[] · required
next_cursor
​string

Create a Crow project (E30)

POST
https://api.hatchmate.nz
/v1/social/projects
Bearer (JWT)

Registers the project in the resource catalogue in the same transaction (SA-3). app_group_id must belong to the acting customer (SA-2).

Create a Crow project (E30) › Headers

Idempotency-Key
​string · uuid

Client-generated UUIDv4. Optional in M0 (API-44). A repeat with the same key and body returns the stored response; a repeat with a different body is 409 idempotency-conflict (API-42).

Create a Crow project (E30) › Request Body

app_group_id
​string · uuid · required
name
​string · minLength: 1 · maxLength: 200 · required
project_type
​string · enum · required
Enum values:
website
youtube
instagram
facebook
threads
reddit
other
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required
base_url
​string · uri

Create a Crow project (E30) › Responses

The project was created.

app_group_id
​string · uuid · required
base_url
​string · required
created_at
​string · date-time · required
customer_id
​string · uuid · required
id
​string · uuid · required
is_active
​boolean · required
name
​string · required
project_type
​string · required
slug
​string · required

Get a Crow project (E31)

GET
https://api.hatchmate.nz
/v1/social/projects/{project_id}
Bearer (JWT)

Foreign-tenant or soft-deleted project is 404, identically (API-11).

Get a Crow project (E31) › path Parameters

project_id
​string · uuid · required

Get a Crow project (E31) › Responses

The project.

app_group_id
​string · uuid · required
base_url
​string · required
created_at
​string · date-time · required
customer_id
​string · uuid · required
id
​string · uuid · required
is_active
​boolean · required
name
​string · required
project_type
​string · required
slug
​string · required

Delete a Crow project (E32)

DELETE
https://api.hatchmate.nz
/v1/social/projects/{project_id}
Bearer (JWT)

Soft-delete with cascade to posts and shares, removing them from the public widget (SA-4, SA-28).

Delete a Crow project (E32) › path Parameters

project_id
​string · uuid · required

Delete a Crow project (E32) › Responses

Deleted.

No data returned

List posts in a project (E33)

GET
https://api.hatchmate.nz
/v1/social/projects/{project_id}/posts
Bearer (JWT)

Live posts ordered published_at DESC (SA-16).

List posts in a project (E33) › path Parameters

project_id
​string · uuid · required

List posts in a project (E33) › query Parameters

cursor
​string

Opaque base64url keyset cursor over (created_at, id) descending. A cursor that does not decode is 422 (API-39, API-40).

limit
​integer · min: 1 · max: 200

Page size. A value above the maximum is 422, never a silent clamp (API-38).

Default: 50

List posts in a project (E33) › Responses

A page of posts.

​CrowPost[] · required
next_cursor
​string

Register a piece of content under a project (E34)

POST
https://api.hatchmate.nz
/v1/social/projects/{project_id}/posts
Bearer (JWT)

content_url must be absolute HTTPS and unique within the project (SA-6, SA-9).

Register a piece of content under a project (E34) › path Parameters

project_id
​string · uuid · required

Register a piece of content under a project (E34) › Headers

Idempotency-Key
​string · uuid

Client-generated UUIDv4. Optional in M0 (API-44). A repeat with the same key and body returns the stored response; a repeat with a different body is 409 idempotency-conflict (API-42).

Register a piece of content under a project (E34) › Request Body

content_type
​string · enum · required
Enum values:
article
video
reel
short
post
other
content_url
​string · uri · required
published_at
​string · date-time · required
content_title
​string

Register a piece of content under a project (E34) › Responses

The post was registered.

content_title
​string · required
content_type
​string · required
content_url
​string · required
created_at
​string · date-time · required
customer_id
​string · uuid · required
excluded
​boolean · required
id
​string · uuid · required
pinned
​boolean · required
project_id
​string · uuid · required
published_at
​string · date-time · required

Get a post (E35)

GET
https://api.hatchmate.nz
/v1/social/projects/{project_id}/posts/{post_id}
Bearer (JWT)

Foreign-tenant or soft-deleted post is 404, identically (API-11).

Get a post (E35) › path Parameters

project_id
​string · uuid · required
post_id
​string · uuid · required

Get a post (E35) › Responses

The post.

content_title
​string · required
content_type
​string · required
content_url
​string · required
created_at
​string · date-time · required
customer_id
​string · uuid · required
excluded
​boolean · required
id
​string · uuid · required
pinned
​boolean · required
project_id
​string · uuid · required
published_at
​string · date-time · required

Partially update a post (E36)

PATCH
https://api.hatchmate.nz
/v1/social/projects/{project_id}/posts/{post_id}
Bearer (JWT)

Only supplied fields change; omitted fields are left unchanged (SA-16b). Excluding a post does not cascade to its shares (SA-29).

Partially update a post (E36) › path Parameters

project_id
​string · uuid · required
post_id
​string · uuid · required

Partially update a post (E36) › Request Body

Only the supplied fields change (`SA-16b`).
content_title
​string
excluded
​boolean
pinned
​boolean

Partially update a post (E36) › Responses

The updated post.

content_title
​string · required
content_type
​string · required
content_url
​string · required
created_at
​string · date-time · required
customer_id
​string · uuid · required
excluded
​boolean · required
id
​string · uuid · required
pinned
​boolean · required
project_id
​string · uuid · required
published_at
​string · date-time · required

List share links for a post (E37)

GET
https://api.hatchmate.nz
/v1/social/projects/{project_id}/posts/{post_id}/shares
Bearer (JWT)

Live shares for the post, most recent first.

List share links for a post (E37) › path Parameters

project_id
​string · uuid · required
post_id
​string · uuid · required

List share links for a post (E37) › query Parameters

cursor
​string

Opaque base64url keyset cursor over (created_at, id) descending. A cursor that does not decode is 422 (API-39, API-40).

limit
​integer · min: 1 · max: 200

Page size. A value above the maximum is 422, never a silent clamp (API-38).

Default: 50

List share links for a post (E37) › Responses

A page of shares.

​CrowShare[] · required
next_cursor
​string

POST
https://api.hatchmate.nz
/v1/social/projects/{project_id}/posts/{post_id}/shares
Bearer (JWT)

Always creates a new row, never reuses an existing one (SA-21a). The utm_campaign value is immutable after insert (SA-22).

project_id
​string · uuid · required
post_id
​string · uuid · required
Idempotency-Key
​string · uuid

Client-generated UUIDv4. Optional in M0 (API-44). A repeat with the same key and body returns the stored response; a repeat with a different body is 409 idempotency-conflict (API-42).

platform
​string · enum · required
Enum values:
linkedin
youtube
facebook
instagram
threads
reddit
twitter
mastodon

The share link was generated.

`utm_url` is present only in the `create_crow_share` response body (`SA-21`); it is not persisted separately from `share_url`.
created_at
​string · date-time · required
crow_post_id
​string · uuid · required
id
​string · uuid · required
platform
​string · required
platform_post_id
​string · required
share_url
​string · required
status
​string · required
utm_campaign
​string · required
widget_approved
​boolean · required
widget_approved_at
​string · date-time · required
utm_url
​string

Approve a share for the public widget (E39)

POST
https://api.hatchmate.nz
/v1/social/projects/{project_id}/shares/{share_id}/approve
Bearer (JWT)

Sets widget_approved=true. Idempotent — a no-op if already approved (SA-18, SA-19).

Approve a share for the public widget (E39) › path Parameters

project_id
​string · uuid · required
share_id
​string · uuid · required

Approve a share for the public widget (E39) › Responses

The share, now approved.

`utm_url` is present only in the `create_crow_share` response body (`SA-21`); it is not persisted separately from `share_url`.
created_at
​string · date-time · required
crow_post_id
​string · uuid · required
id
​string · uuid · required
platform
​string · required
platform_post_id
​string · required
share_url
​string · required
status
​string · required
utm_campaign
​string · required
widget_approved
​boolean · required
widget_approved_at
​string · date-time · required
utm_url
​string

UTM pageview attribution for a share (E42)

GET
https://api.hatchmate.nz
/v1/social/projects/{project_id}/shares/{share_id}/attribution
Bearer (JWT)

Best-effort — null when Umami is unreachable or returns a non-2xx response, never a 5xx on the caller's behalf (SA-24, SA-27). The Umami token is sent only via the upstream Authorization header, never logged or echoed (SA-31).

UTM pageview attribution for a share (E42) › path Parameters

project_id
​string · uuid · required
share_id
​string · uuid · required

UTM pageview attribution for a share (E42) › Responses

Attribution stats, or null if Umami was unavailable.

anyOf
At least one variant must match. Multiple variants may match simultaneously.

Decision Table

VariantMatching Criteria
type = object · requires: utm_campaign, pageviews, visits +4 more
type = null
Properties for CrowAttributionStats:
Mirrors `hatchmate.social.attribution.AttributionStats` (`SA-24`).
​object[] · required
pageviews
​integer · min: 0 · required
period_end
​string · date-time · required
period_start
​string · date-time · required
referrer
​string · required
utm_campaign
​string · required
visits
​integer · min: 0 · required

Record that a share was actually posted (E41)

POST
https://api.hatchmate.nz
/v1/social/projects/{project_id}/shares/{share_id}/delivered
Bearer (JWT)

Race-safe conditional update; a share already delivered is 409 conflict (ShareAlreadyDelivered, SA-23). share_url must be an absolute HTTPS URL (SA-6); an invalid one is rejected before any state changes.

Record that a share was actually posted (E41) › path Parameters

project_id
​string · uuid · required
share_id
​string · uuid · required

Record that a share was actually posted (E41) › Headers

Idempotency-Key
​string · uuid

Client-generated UUIDv4. Optional in M0 (API-44). A repeat with the same key and body returns the stored response; a repeat with a different body is 409 idempotency-conflict (API-42).

Record that a share was actually posted (E41) › Request Body

share_url
​string · uri · required
platform_post_id
​string

Record that a share was actually posted (E41) › Responses

The share, now delivered.

`utm_url` is present only in the `create_crow_share` response body (`SA-21`); it is not persisted separately from `share_url`.
created_at
​string · date-time · required
crow_post_id
​string · uuid · required
id
​string · uuid · required
platform
​string · required
platform_post_id
​string · required
share_url
​string · required
status
​string · required
utm_campaign
​string · required
widget_approved
​boolean · required
widget_approved_at
​string · date-time · required
utm_url
​string

Unapprove a share, removing it from the public widget (E40)

POST
https://api.hatchmate.nz
/v1/social/projects/{project_id}/shares/{share_id}/unapprove
Bearer (JWT)

Sets widget_approved=false, leaves widget_approved_at unchanged. Idempotent (SA-18, SA-20).

Unapprove a share, removing it from the public widget (E40) › path Parameters

project_id
​string · uuid · required
share_id
​string · uuid · required

Unapprove a share, removing it from the public widget (E40) › Responses

The share, now unapproved.

`utm_url` is present only in the `create_crow_share` response body (`SA-21`); it is not persisted separately from `share_url`.
created_at
​string · date-time · required
crow_post_id
​string · uuid · required
id
​string · uuid · required
platform
​string · required
platform_post_id
​string · required
share_url
​string · required
status
​string · required
utm_campaign
​string · required
widget_approved
​boolean · required
widget_approved_at
​string · date-time · required
utm_url
​string