Set output schema
Set the target JSON output schema for the project. This triggers automatic agent creation and mapping generation in the background. Poll GET /projects/{project_id}/schema/ until mapping_status is success before fetching results.
On this page
HTTP request
PUT https://api.parsewise.ai/api/v1/projects/{project_id}/schema/
URI Parameters
Name
In
Required
Type
Description
project_id
path
Yes
string (uuid)
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
schema
Yes
any
A valid JSON Schema (Draft 2020-12) describing the desired output shape.
Responses
Status
Type
Description
200
object<string, any>
—
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 = {
" schema " : " ... " ,
}
resp = requests . put (
f " { BASE_URL } /projects/ { project_id } /schema/ " ,
headers = { " X-API-Key " : API_KEY },
json = body ,
)
resp . raise_for_status ()
print ( resp . json () if resp . content else None )
Definitions
V1SchemaSetRequestRequest
Name
Required
Type
Description
schema
Yes
any
A valid JSON Schema (Draft 2020-12) describing the desired output shape.