Skip to content
Developer docs
⌘ K
Dashboard ↗

HTTP endpoints

setPlacement

Points key at a program, creating the key if needed. Needs programs:write.

PUT /api/v1/placements/{key}

Requires programs:write. Keep the Bearer key on your server.

Creates the key or moves it to another program. The program's version does not change.

SDK

ts
grizzlee.setPlacement(key: string, input: { programId: string; }): Promise<Placement>

HTTP

Use your backend's HTTP client. The cURL request shows the wire format. Replace path parameters and example values.

sh
curl --fail-with-body --request PUT \
  'https://app.grizzlee.ca/api/v1/placements/{key}' \
  -H "Authorization: Bearer $GRIZZLEE_SERVER_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"programId":"program-example"}'

Request body

FieldTypeRequiredDetails
programIdstringYes

Request schema

json
{
  "type": "object",
  "properties": {
    "programId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "programId"
  ],
  "additionalProperties": false
}

Response

HTTP responses wrap this value in data. The SDK returns the value directly unless the note above describes a wrapper.

FieldTypeRequiredDetails
keystringYes
programIdstringYes
createdAtstringYes
updatedAtstringYes

Response schema

json
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string"
    },
    "programId": {
      "type": "string"
    },
    "createdAt": {
      "type": "string"
    },
    "updatedAt": {
      "type": "string"
    }
  },
  "required": [
    "key",
    "programId",
    "createdAt",
    "updatedAt"
  ]
}

Errors

Failures return { "error": { "code": "...", "message": "...", "details": {} } }. Details are optional. See error statuses. Reuse an unchanged event payload when retrying.