Skip to main content
SONZAI
Api

Skills

List skills enabled for an agent

GET
/agents/{agentId}/skills/enabled
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded name the enabled set belongs to

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/skills/enabled"
{
  "$schema": "/api/v1/schemas/ListEnabledSkillsOutputBody.json",
  "skills": [
    "string"
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Toggle a skill's enabled flag for an agent

POST
/agents/{agentId}/skills/enabled
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded name the enabled set belongs to

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/agents/string/skills/enabled" \  -H "Content-Type: application/json" \  -d '{    "enabled": true,    "skill_name": "string"  }'
{
  "$schema": "/api/v1/schemas/ToggleEnabledSkillOutputBody.json",
  "enabled": true,
  "skill_name": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Read the per-agent load counter for a skill

GET
/agents/{agentId}/skills/enabled/{skillName}/load-count
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded name the counter belongs to

skillName*string

Skill name to read the counter for

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/skills/enabled/string/load-count"
{
  "$schema": "/api/v1/schemas/GetSkillLoadCountOutputBody.json",
  "count": 0,
  "skill_name": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List skills in a project library

GET
/projects/{projectId}/skills
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID the skills belong to

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/skills"
{
  "$schema": "/api/v1/schemas/ListProjectSkillsOutputBody.json",
  "skills": [
    {
      "$schema": "/api/v1/schemas/Skill.json",
      "author": "string",
      "author_agent_id": "string",
      "author_user_id": "string",
      "content": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "description": "string",
      "name": "string",
      "project_id": "string",
      "tenant_id": "string",
      "updated_at": "2019-08-24T14:15:22Z",
      "version": 0,
      "when_to_use": "string"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Create or upsert a skill in a project library

POST
/projects/{projectId}/skills
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID the skill belongs to

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/skills" \  -H "Content-Type: application/json" \  -d '{    "content": "string",    "description": "string",    "name": "string"  }'
{
  "$schema": "/api/v1/schemas/Skill.json",
  "author": "string",
  "author_agent_id": "string",
  "author_user_id": "string",
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "name": "string",
  "project_id": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "version": 0,
  "when_to_use": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Read a skill from a project library

GET
/projects/{projectId}/skills/{name}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID the skill belongs to

name*string

Skill name within the project

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/skills/string"
{
  "$schema": "/api/v1/schemas/Skill.json",
  "author": "string",
  "author_agent_id": "string",
  "author_user_id": "string",
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "name": "string",
  "project_id": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "version": 0,
  "when_to_use": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Remove a skill from a project library

DELETE
/projects/{projectId}/skills/{name}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID the skill belongs to

name*string

Skill name within the project

Response Body

application/problem+json

curl -X DELETE "https://loading/api/v1/projects/string/skills/string"
Empty
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Update a skill in a project library

PUT
/projects/{projectId}/skills/{name}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID the skill belongs to

name*string

Skill name within the project

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X PUT "https://loading/api/v1/projects/string/skills/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "$schema": "/api/v1/schemas/Skill.json",
  "author": "string",
  "author_agent_id": "string",
  "author_user_id": "string",
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "name": "string",
  "project_id": "string",
  "tenant_id": "string",
  "updated_at": "2019-08-24T14:15:22Z",
  "version": 0,
  "when_to_use": "string"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}