- Base URL:
https://purpose.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/purpose
import { epilot } from '@epilot/sdk' epilot.authorize(() => '<token>') const { data } = await epilot.purpose.createPurpose(...)
import { getClient, authorize } from '@epilot/sdk/purpose' const purposeClient = getClient() authorize(purposeClient, () => '<token>') const { data } = await purposeClient.createPurpose(...)
Purpose
Schemas
Create a new purpose.
POST /v1/purpose
const { data } = await client.createPurpose( null, { name: 'Electricity Contract' }, )
Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-01T08:00:00.000Z"
}Search purposes using fuzzy matching against the purpose name.
GET /v1/purpose:search
const { data } = await client.searchPurposes({ query: 'example', size: 1, })
Response
{
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-01T08:00:00.000Z"
}
]
}Fetch multiple purposes by their known IDs in a single request.
POST /v1/purpose:batchGet
const { data } = await client.batchGetPurposes( null, { purposeIds: ['123e4567-e89b-12d3-a456-426614174000', '987fcdeb-51a2-43f7-9012-345678901234'] }, )
Response
{
"results": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-01T08:00:00.000Z"
}
],
"hits": 2
}Get a single purpose by its UUID.
GET /v1/purpose/{purposeId}
const { data } = await client.getPurpose({ purposeId: 'example', })
Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-01T08:00:00.000Z"
}Update an existing purpose.
PUT /v1/purpose/{purposeId}
const { data } = await client.updatePurpose( { purposeId: 'example', }, { name: 'Electricity & Gas Contract' }, )
Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-01T08:00:00.000Z"
}Permanently delete a purpose by its UUID.
DELETE /v1/purpose/{purposeId}
const { data } = await client.deletePurpose({ purposeId: 'example', })
Response
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Electricity Contract",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-06-01T08:00:00.000Z"
}An epilot Purpose – a named taxonomy label used to tag and organize resources across the platform
type Purpose = { id: string // uuid name: string created_at?: string // date-time updated_at?: string // date-time }
Input for creating a new purpose
type CreatePurposeInput = { name: string }
Input for updating an existing purpose
type UpdatePurposeInput = { name?: string }
Input for batch-fetching purposes by their IDs
type BatchGetPurposesInput = { purposeIds: string // uuid[] }
type Error = { status?: number error?: string message?: string }