Gamma API

Create a worker credential

POST
/api/organizations/{slug}/workers

A worker claiming with it takes only this organization's jobs, of its types. The platform's workers share those jobs unless they run only on the organization's own workers (PATCH above). The secret is in this answer only.

Who may call it: An owner or security admin of the organization. API keys: no.

Authorization

session
cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Host- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

Path Parameters

slug*string

The organization's slug, as in its URL.

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100
types*array<>
Items1 <= items <= 20

Response Body

Created.

application/json
  1. response
credential*

What one of the organization's own job workers claims with. Its secret is shown once, on creation.

secret*string
Example Request
curl -X POST 'http://localhost:3000/api/organizations/string/workers' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "types": [    "string"  ]}'
Example Response
{  "credential": {    "id": "string",    "name": "string",    "types": [      "string"    ],    "start": "string",    "createdAt": "2019-08-24T14:15:22Z",    "lastUsedAt": "2019-08-24T14:15:22Z",    "revokedAt": "2019-08-24T14:15:22Z"  },  "secret": "string"}