Hatchmate Core API

Customers, teams, memberships and app groups.


List app groups (E15)

GET
https://api.hatchmate.nz
/v1/app-groups
Bearer (JWT)

Live app groups of the acting customer, keyset-paginated (API-61).

List app groups (E15) › 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 app groups (E15) › Responses

A page of live app groups of the acting customer.

​AppGroup[] · required
next_cursor
​string | null · required

Create an app group (E16)

POST
https://api.hatchmate.nz
/v1/app-groups
Bearer (JWT)

The slug default is reserved and rejected 422 (TM-13, API-61).

Create an app group (E16) › 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 an app group (E16) › Request Body

name
​string · minLength: 1 · maxLength: 200 · required
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required

The slug default is reserved and rejected (TM-13).

Create an app group (E16) › Responses

The app group was created.

created_at
​string · date-time · required
id
​string · uuid · required
is_default
​boolean · required
name
​string · minLength: 1 · maxLength: 200 · required
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required

Delete an app group (E17)

DELETE
https://api.hatchmate.nz
/v1/app-groups/{group_id}
Bearer (JWT)

The default group cannot be deleted (422, TM-15). Any other group reassigns its catalogue rows to default in the same transaction and bumps the epoch (API-62).

Delete an app group (E17) › path Parameters

group_id
​string · uuid · required

Delete an app group (E17) › 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).

Delete an app group (E17) › Responses

The app group was deleted. No body.

No data returned

The acting customer (E4)

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

Returns the customer named by the token. Runs the membership guard like every other authenticated operation; a caller whose membership is absent or soft-deleted receives 404 (API-10, API-52).

The acting customer (E4) › Responses

The acting customer.

created_at
​string · date-time · required
id
​string · uuid · required
legal_name
​string · minLength: 1 · maxLength: 200 · required
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required
status
​string · enum · required
Enum values:
active
suspended
closed

List memberships (E12)

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

Memberships of the acting customer. Returns user_id and identity_id and never an email address or display name (API-58).

List memberships (E12) › 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 memberships (E12) › Responses

A page of memberships of the acting customer.

​Membership[] · required
next_cursor
​string | null · required

Create a membership (E13)

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

Binds exactly one identity (ADR-002, TM-6, API-59).

Create a membership (E13) › 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 membership (E13) › Request Body

identity_id
​string · uuid · required

ADR-002 — binds exactly one identity.

user_id
​string · uuid · required

Create a membership (E13) › Responses

The membership was created.

created_at
​string · date-time · required
id
​string · uuid · required
identity_id
​string · uuid · required
user_id
​string · uuid · required

Delete a membership (E14)

DELETE
https://api.hatchmate.nz
/v1/memberships/{membership_id}
Bearer (JWT)

Soft-deletes the membership and every team membership referencing it in the same transaction, then bumps the epoch (API-60).

Delete a membership (E14) › path Parameters

membership_id
​string · uuid · required

Delete a membership (E14) › 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).

Delete a membership (E14) › Responses

The membership was deleted. No body.

No data returned

List teams (E5)

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

Live teams of the acting customer only, keyset-paginated (API-53).

List teams (E5) › 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 teams (E5) › Responses

A page of teams.

​Team[] · required
next_cursor
​string | null · required

null when the page is the last one (API-41).


Create a team (E6)

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

Creates a team in the acting customer and returns 201 with a Location header (API-53).

Create a team (E6) › 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 team (E6) › Request Body

name
​string · minLength: 1 · maxLength: 200 · required
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required

Create a team (E6) › Responses

The team was created.

created_at
​string · date-time · required
id
​string · uuid · required
name
​string · minLength: 1 · maxLength: 200 · required
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required

Fetch a team (E7)

GET
https://api.hatchmate.nz
/v1/teams/{team_id}
Bearer (JWT)

A team in another customer, a soft-deleted team and an absent team are one 404; a denial on a team that does live in the acting customer is 403 (API-54, API-92).

Fetch a team (E7) › path Parameters

team_id
​string · uuid · required

Fetch a team (E7) › Responses

The team.

created_at
​string · date-time · required
id
​string · uuid · required
name
​string · minLength: 1 · maxLength: 200 · required
slug
​string · pattern: ^[a-z0-9][a-z0-9-]{0… · required

Delete a team (E8)

DELETE
https://api.hatchmate.nz
/v1/teams/{team_id}
Bearer (JWT)

Soft-deletes and bumps permissions_epoch before returning (API-54).

Delete a team (E8) › path Parameters

team_id
​string · uuid · required

Delete a team (E8) › 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).

Delete a team (E8) › Responses

The team was deleted. No body.

No data returned

List team members (E9)

GET
https://api.hatchmate.nz
/v1/teams/{team_id}/members
Bearer (JWT)

Live team_memberships rows for the path team, joined to memberships for user_id and identity_id. Never an email address or display name (API-93, API-58).

List team members (E9) › path Parameters

team_id
​string · uuid · required

List team members (E9) › 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 team members (E9) › Responses

A page of team memberships.

​TeamMember[] · required
next_cursor
​string | null · required

Add a member to a team (E10)

POST
https://api.hatchmate.nz
/v1/teams/{team_id}/members
Bearer (JWT)

Takes a membership_id; a membership whose customer differs from the team's is 422 tenancy-violation. Bumps the epoch on success (API-56, TM-9).

Add a member to a team (E10) › path Parameters

team_id
​string · uuid · required

Add a member to a team (E10) › 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).

Add a member to a team (E10) › Request Body

membership_id
​string · uuid · required

Add a member to a team (E10) › Responses

The membership was added to the team.

created_at
​string · date-time · required
id
​string · uuid · required
membership_id
​string · uuid · required
team_id
​string · uuid · required
user_id
​string · uuid · required

Remove a member from a team (E11)

DELETE
https://api.hatchmate.nz
/v1/teams/{team_id}/members/{membership_id}
Bearer (JWT)

Soft-deletes and bumps the epoch. Removing the last member of a team is permitted (API-57, ADR-003).

Remove a member from a team (E11) › path Parameters

team_id
​string · uuid · required
membership_id
​string · uuid · required

Remove a member from a team (E11) › 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).

Remove a member from a team (E11) › Responses

The team membership was removed. No body.

No data returned