Our Python SDK got smarter. We developed a Typscript SDK too. We are updating our SDK code blocks. Python SDKhere.Typscript SDKhere.
Description
Patronus AI APIError taxonomy

Create Error Taxonomy Revision

Create a new error taxonomy revision.

If error_taxonomy_id is provided, creates a new revision of an existing error taxonomy definition.

If error_taxonomy_id is not provided but error_taxonomy_name is, creates a new error taxonomy

definition with its first revision.

project_id must be provided.

Returns the newly created error taxonomy revision.

POST
/v1/error-taxonomy-revision
/v1/error-taxonomy-revision

The Authorization access token

Authorization

X-API-KEY<token>

In: header

Request Body

application/jsonRequired

project_id
Required
Project Id

Format: "uuid"

error_taxonomy_idError Taxonomy Id

error_taxonomy_nameError Taxonomy Name

error_taxonomy_descriptionError Taxonomy Description

taxonomy_typeTaxonomy Type

Default: "user"Value in: "system" | "user"

create_only_if_not_existsCreate Only If Not Exists

If true, creation will fail if a error taxonomy with the same name already exists in the project. Only applies when creating a new error taxonomy (not providing error_taxonomy_id).

Default: false

body
Required
ErrorTaxonomyNode

metadataMetadata

Optional JSON metadata to associate with this revision

curl -X POST "https://api.patronus.ai/v1/error-taxonomy-revision" \
  -H "X-API-KEY: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "error_taxonomy_id": "35853996-23d7-4178-b5ab-cb36a4fb6267",
    "error_taxonomy_name": "string",
    "error_taxonomy_description": "string",
    "taxonomy_type": "system",
    "create_only_if_not_exists": false,
    "body": {
      "name": "string",
      "description": "string",
      "type": "category",
      "subcategories": [
        {
          "name": "string",
          "description": "string",
          "type": "category",
          "subcategories": [
            {}
          ]
        }
      ]
    },
    "metadata": {}
  }'

Successful Response

{
  "error_taxonomy_revision": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "error_taxonomy_definition_id": "7285da25-4d31-4014-80fc-9c3588bb6f5d",
    "error_taxonomy_definition_name": "string",
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "taxonomy_type": "system",
    "revision": 0,
    "body": {},
    "metadata": {},
    "labels": [
      "string"
    ],
    "created_at": "2019-08-24T14:15:22Z"
  }
}