Skip to content

Persona routes: update, delete

The Persona Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for Persona, one group of Persona routes.

Persona.update

Changes the given properties of a Persona. Verb page.

Text
PATCH /{namespace}/personas/{id}

Path: id. Body, as JSON: the other inputs. Emits Persona.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Persona.
jobtextWhat they come to get done.
fromstringLineage: the slot it compiles from, as Hypothesis#<slot>@v<version>.

Returns

OutputTypeRequiredDescription
personaPersonarequiredThe Persona.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X PATCH https://api.sb/leaseline.app/personas/persona_YdpO6wSexq \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"Hypothesis#approach@v1"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "persona": {
    "$id": "https://api.sb/leaseline.app/personas/persona_YdpO6wSexq",
    "$type": "Persona",
    "job": "Example job",
    "from": "Hypothesis#approach@v1"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Persona.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Persona.delete

Deletes a Persona: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/personas/{id}

Path: id. Emits Persona.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Persona.

Returns

OutputTypeRequiredDescription
personaPersonarequiredThe Persona.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X DELETE https://api.sb/leaseline.app/personas/persona_YdpO6wSexq \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "persona": {
    "$id": "https://api.sb/leaseline.app/personas/persona_YdpO6wSexq",
    "$type": "Persona",
    "job": "Example job"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Persona.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}