Skip to content

Data

Collections, records, project keys and change hook deliveries.

On this page

Concepts: Data

Endpoint summaries come from the OpenAPI document.

GET/v1/projects/{project}/collections

Collections of the project's headless data layer with their schema, rules and record counts

Operation (MCP tool)
listCollections
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKobject
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/projects/{project}/collections

Create a collection: name, fields, access rules and optional change hook. The first collection also creates the publishable key

Operation (MCP tool)
createCollection
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
Idempotency-KeyOptionalheaderstringReplays the first response for 24 hourslength 8–128

Request body

application/jsonCollectionInputRequired

Request body
NameTypeDescription
nameRequiredstringpattern ^[a-z][a-z0-9_-]{0,63}$
fieldsRequiredField[]
rulesOptionalRules
hookOptionalHook | null

Responses

Responses
StatusDescriptionBody
201CreatedCollection
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)

GET/v1/projects/{project}/collections/{collection}

One collection

Operation (MCP tool)
getCollection
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKCollection
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

PATCH/v1/projects/{project}/collections/{collection}

Change fields (the full list), rules or the change hook. A field's type cannot change; making read, update or delete public needs a person, not an agent

Operation (MCP tool)
updateCollection
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring

Request body

application/jsonobjectRequired

Request body
NameTypeDescription
fieldsOptionalField[]
rulesOptionalRules
hookOptionalHook | null

Responses

Responses
StatusDescriptionBody
200OKCollection
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
409ProblemProblem (RFC 9457)

DELETE/v1/projects/{project}/collections/{collection}

Delete a collection and its records

Operation (MCP tool)
deleteCollection
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring

Responses

Responses
StatusDescriptionBody
204DeletedNo content
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

GET/v1/projects/{project}/collections/{collection}/export

Export every record as CSV or JSON (a file). Not with the publishable key

Operation (MCP tool)
exportCollection
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring

Responses

Responses
StatusDescriptionBody
200Filestring
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

GET/v1/projects/{project}/data/{collection}

List records. filter[field]=value or filter[field][gte]=… (eq, ne, gt, gte, lt, lte, in) and sort=-createdAt on indexed and system fields. Counts toward the monthly data requests

Operation (MCP tool)
listRecords
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)Publishable data key (pfp_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring
filterOptionalqueryobjectfilter[field]=value or filter[field][op]=value (eq, ne, gt, gte, lt, lte, in)
sortOptionalquerystring
limitOptionalqueryintegermin 1, max 100, default 50
cursorOptionalquerystring

Responses

Responses
StatusDescriptionBody
200OKobject
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/projects/{project}/data/{collection}

Add a record (the body is the record's fields). With the publishable key only when the collection's create rule is public

Operation (MCP tool)
createRecord
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)Publishable data key (pfp_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring

Request body

application/jsonobjectRequired

Responses

Responses
StatusDescriptionBody
201CreatedRecord
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
402ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
413ProblemProblem (RFC 9457)
422ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

GET/v1/projects/{project}/data/{collection}/{record}

One record

Operation (MCP tool)
getRecord
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)Publishable data key (pfp_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring
recordRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKRecord
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

PATCH/v1/projects/{project}/data/{collection}/{record}

Change some fields; null removes a field

Operation (MCP tool)
updateRecord
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)Publishable data key (pfp_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring
recordRequiredpathstring

Request body

application/jsonobjectRequired

Responses

Responses
StatusDescriptionBody
200OKRecord
400ProblemProblem (RFC 9457)
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
413ProblemProblem (RFC 9457)
422ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

DELETE/v1/projects/{project}/data/{collection}/{record}

Delete a record

Operation (MCP tool)
deleteRecord
Authentication
API key (pfa_…)OAuth token (pfo_…)Secret data key (pfk_…)Publishable data key (pfp_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring
collectionRequiredpathstring
recordRequiredpathstring

Responses

Responses
StatusDescriptionBody
204DeletedNo content
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)
429ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

GET/v1/projects/{project}/data-keys

The project's publishable key and whether a secret key and webhook secret exist (the secret is never shown again)

Operation (MCP tool)
getDataKeys
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKDataKeys
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/projects/{project}/data-keys/publishable

Replace the publishable key; the old one stops working at once. Needs keys.manage and a person's key

Operation (MCP tool)
rotatePublishableKey
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKDataKeys
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

POST/v1/projects/{project}/data-keys/secret

Create or replace the secret key; returned once. It becomes the PERAFLY_SECRET_KEY environment variable from the next version. Needs keys.manage and a person's key

Operation (MCP tool)
createSecretKey
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring

Responses

Responses
StatusDescriptionBody
201Createdobject
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

DELETE/v1/projects/{project}/data-keys/secret

Revoke the secret key

Operation (MCP tool)
revokeSecretKey
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKDataKeys
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.

GET/v1/projects/{project}/hook-deliveries

The last 50 change hook deliveries

Operation (MCP tool)
listHookDeliveries
Authentication
API key (pfa_…)OAuth token (pfo_…)

Parameters

Parameters
NameInTypeDescription
projectRequiredpathstring

Responses

Responses
StatusDescriptionBody
200OKobject
401ProblemProblem (RFC 9457)
403ProblemProblem (RFC 9457)
404ProblemProblem (RFC 9457)

Related error codes

Error codes this endpoint and its part of the API answer with. Each one explains what happened and what to do.