Business RecordsCreate a business record schemapost

Create a business record schema

Creates a schema that defines structured record types, fields, and relationships for a team or Vault.

curl -X POST "https://api.textmine.com/v3/record-schemas" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (`tm_<key>`)" \
  -d '{
  "teamId": 321,
  "vaultId": 12345,
  "name": "Supplier master data",
  "description": "Structured supplier facts extracted from contracts.",
  "scopeType": "VAULT",
  "scopeId": "12345",
  "schema": {
    "recordTypes": [
      {
        "recordTypeKey": "supplier",
        "label": "Supplier",
        "fields": [
          {
            "fieldKey": "jurisdiction",
            "label": "Jurisdiction",
            "fieldType": "text",
            "evidenceRequired": true
          },
          {
            "fieldKey": "renewal_type",
            "label": "Renewal type",
            "fieldType": "text",
            "evidenceRequired": true
          }
        ]
      }
    ],
    "relationshipTypes": []
  }
}'
{
  "id": 3001,
  "teamId": 123,
  "vaultId": 123,
  "name": "John Doe",
  "description": "example_string",
  "status": "active",
  "scopeType": "example_string",
  "scopeId": "example_string",
  "activeVersionId": 123,
  "created": "2024-12-25T10:00:00Z",
  "updated": "2024-12-25T10:00:00Z",
  "versions": [
    {
      "id": 4001,
      "schemaId": 3001,
      "versionNumber": 1,
      "status": "active",
      "recordTypes": [
        {
          "id": 5001,
          "recordTypeKey": "supplier",
          "label": "Supplier"
        }
      ],
      "relationshipTypes": []
    }
  ]
}
POST
/v3/record-schemas
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (`tm_<key>`)
Bearer Tokenstring
Required

Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.

Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.
Content-Typestring
Required

The media type of the request body

Options: application/json
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (tm_<key>). Use Authorization: Bearer tm_<key> for API-key access to /v3/** endpoints. V3 also accepts Auth0 JWT and HTTP Basic for user-session contexts.

Body

application/json
vaultIdinteger
Example:
12345
namestring
Required
Example:
Supplier master data
descriptionstring
Example:
Structured supplier facts extracted from contracts.
scopeTypestring
Example:
VAULT
scopeIdstring
Example:
12345
suggestionPromptstring
Example:
Track supplier name, jurisdiction, renewal type, and termination notice.
schemaobject

Responses