Partially update a dimension

Update one or more fields on an existing dimension (supply only the fields you want to change). Renaming is subject to the same name-collision rules as create. Returns the updated dimension.

On this page

HTTP request

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

URI Parameters

Name In Required Type Description
dimension_id path Yes string (uuid)  
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 No 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
200 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"

dimension_id = "<uuid>"
project_id = "<uuid>"

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

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

Definitions

PatchedV1DimensionRequest

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 No 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”.

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.

V1DimensionValueTypeEnum

Type: string. One of:

  • string
  • number
  • bool
  • date
  • datetime