Skip to main content

Purpose API

Purpose API - enables the management of purposes for the epilot platform.

Quick Startโ€‹

# List available operations
epilot purpose

# Call an operation
epilot purpose createPurpose

Common Flagsโ€‹

FlagDescription
-p key=valueSet a named parameter
-d '{...}'Request body JSON
-H 'Key: Value'Custom header
-t, --token <token>Bearer token for authentication
--profile <name>Use a named profile
-s, --server <url>Override server base URL
-i, --includeInclude response headers in output
--jsonOutput raw JSON (no formatting)
-v, --verboseVerbose output (show request details)
--jsonata <expr>JSONata expression to transform response
--definition <file>Override OpenAPI spec file/URL
--guidedPrompt for all parameters interactively
--no-interactiveDisable interactive prompts

Operationsโ€‹

Purpose

createPurposeโ€‹

Create a new purpose

POST /v1/purpose

Request Body (required)

Sample Call

epilot purpose createPurpose \
-d '{"name":"Electricity Contract"}'

Using stdin pipe:

cat body.json | epilot purpose createPurpose

With JSONata filter:

epilot purpose createPurpose --jsonata 'id'
Sample Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}

searchPurposesโ€‹

Search purposes using fuzzy matching.

GET /v1/purpose:search

Parameters

NameInTypeRequiredDescription
queryquerystringNoSearch query string
sizequerynumberNoMaximum number of results to return

Sample Call

epilot purpose searchPurposes

With JSONata filter:

epilot purpose searchPurposes --jsonata 'results[0]'
Sample Response
{
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
]
}

batchGetPurposesโ€‹

Fetch multiple purposes by their known IDs in a single request.

POST /v1/purpose:batchGet

Request Body (required)

Sample Call

epilot purpose batchGetPurposes \
-d '{"purposeIds":["123e4567-e89b-12d3-a456-426614174000"]}'

Using stdin pipe:

cat body.json | epilot purpose batchGetPurposes

With JSONata filter:

epilot purpose batchGetPurposes --jsonata 'results[0]'
Sample Response
{
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}
],
"hits": 0
}

getPurposeโ€‹

Get a single purpose by ID

GET /v1/purpose/{purposeId}

Parameters

NameInTypeRequiredDescription
purposeIdpathstringYesPurpose ID (UUID)

Sample Call

epilot purpose getPurpose \
-p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217

Using positional args for path parameters:

epilot purpose getPurpose 1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217

With JSONata filter:

epilot purpose getPurpose -p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217 --jsonata 'id'
Sample Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}

updatePurposeโ€‹

Update an existing purpose

PUT /v1/purpose/{purposeId}

Parameters

NameInTypeRequiredDescription
purposeIdpathstringYesPurpose ID (UUID)

Request Body (required)

Sample Call

epilot purpose updatePurpose \
-p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217 \
-d '{"name":"string"}'

Using positional args for path parameters:

epilot purpose updatePurpose 1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217

Using stdin pipe:

cat body.json | epilot purpose updatePurpose -p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217

With JSONata filter:

epilot purpose updatePurpose -p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217 --jsonata 'id'
Sample Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}

deletePurposeโ€‹

Permanently delete a purpose

DELETE /v1/purpose/{purposeId}

Parameters

NameInTypeRequiredDescription
purposeIdpathstringYesPurpose ID (UUID)

Sample Call

epilot purpose deletePurpose \
-p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217

Using positional args for path parameters:

epilot purpose deletePurpose 1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217

With JSONata filter:

epilot purpose deletePurpose -p purposeId=1fdc8f66-0e2b-4e20-a347-9cbdbf6a7217 --jsonata 'id'
Sample Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "1970-01-01T00:00:00.000Z",
"updated_at": "1970-01-01T00:00:00.000Z"
}