Request
POST /v1/flocks
Authenticate with a bearer token. Create one with POST /v1/tokens or cluck login.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Flock name |
role | string | Default role (chick, hen, rooster) |
Example
curl -X POST https://api.pollosoft.example/v1/flocks \
-H "Authorization: Bearer $COOP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "example-name", "role": "example-role"}'
Response
A successful call returns 201 Created with JSON like this:
{
"id": "flk_31aa",
"name": "data-team",
"members": 0,
"role": "chick"
}
Errors
HEN-2001(401): Not logged inHEN-2004(403): Insufficient pecking orderHEN-5001(429): Too many pecksHEN-1002(400): Missing required field
IdempotencySend an
Idempotency-Key header to make retries safe. We will return the original result instead of laying a second egg.