Create a dimension

Create a new dimension on the project. The name must be unique within the project, must not match the reserved system dimension name Document, and must not collide with an existing tag key on the project. Returns the created dimension.

On this page

HTTP request

POST https://api.parsewise.ai/api/v1/projects/{project_id}/dimensions/

URI Parameters

Name In Required Type Description
project_id path Yes string (uuid)  

Request Header

Name Required Type Description
X-API-Key Yes string API key with the pw_live_ prefix. See Authentication.

Request Body

Supported content types: application/json, application/x-www-form-urlencoded, multipart/form-data.

Name Required Type Description
name Yes string Human-readable name of the dimension. Must be unique within the project. Cannot match the reserved system dimension name “Document” or any of the project’s tag keys.
description No string Optional free-form description of what this dimension captures.
example_values No string Optional comma-separated list of example values to help guide extraction.
value_type No V1DimensionValueTypeEnum Data type of the dimension value. Defaults to “string”.

Responses

Status Type Description
201 V1Dimension

Security

  • ApiKeyAuth — apiKey — in X-API-Key header. API key with pw_live_ prefix.

Python example

import os
import requests

API_KEY = os.environ["PARSEWISE_API_KEY"]
BASE_URL = "https://api.parsewise.ai/api/v1"

project_id = "<uuid>"

body = {
    "name": "...",
    "description": "...",  # optional
    "example_values": "...",  # optional
    "value_type": "string",  # optional
}

resp = requests.post(
    f"{BASE_URL}/projects/{project_id}/dimensions/",
    headers={"X-API-Key": API_KEY},
    json=body,
)
resp.raise_for_status()
print(resp.json() if resp.content else None)

Definitions

V1Dimension

A dimension is a project-scoped attribute that an agent extracts a value for on each document (e.g. Year, Region). Dimensions are referenced by ID when attaching them to agents and when reading extraction results.

Name Required Type Description
id Yes string (uuid) Stable identifier for the dimension (UUID).
project_id Yes string (uuid) Identifier of the project this dimension belongs to.
name Yes string Human-readable name of the dimension. Must be unique within the project. Cannot match the reserved system dimension name “Document” or any of the project’s tag keys.
description No string Optional free-form description of what this dimension captures.
example_values No string Optional comma-separated list of example values to help guide extraction.
value_type No V1DimensionValueTypeEnum Data type of the dimension value. Defaults to “string”.
created_at Yes string (date-time) Timestamp the dimension was created.

V1DimensionRequest

A dimension is a project-scoped attribute that an agent extracts a value for on each document (e.g. Year, Region). Dimensions are referenced by ID when attaching them to agents and when reading extraction results.

Name Required Type Description
name Yes string Human-readable name of the dimension. Must be unique within the project. Cannot match the reserved system dimension name “Document” or any of the project’s tag keys.
description No string Optional free-form description of what this dimension captures.
example_values No string Optional comma-separated list of example values to help guide extraction.
value_type No V1DimensionValueTypeEnum Data type of the dimension value. Defaults to “string”.

V1DimensionValueTypeEnum

Type: string. One of:

  • string
  • number
  • bool
  • date
  • datetime