Base URL and version
GET /api/cli/v1/auth/config needs a bearer credential. See Authentication.
Request bodies are JSON objects. Send Content-Type: application/json with every body. The setup and workspace routes reject a body without that header.
Reference pages
For the events Pointed sends to your endpoint, see Webhooks.
Response format
A successful response hasdata and meta. data is an object or an array, depending on the route.
error and meta. error is a sentence written for a person.
meta.code.
meta.code. Do not match on the text of error. It can change.
A few routes differ from this format:
GET /api/cli/v1/auth/configreturns a bare object with nodataormeta.- The workspace routes put the error code in a top-level
codefield, next toerror. - The setup routes add
meta.retryableto every error. PUT /api/cli/v1/interview-settings/{kind}/{id}answers a revision conflict with status 409 and a normaldataobject.
/accounts is relative to the base URL.
Request IDs
Every response in the standard format carriesmeta.requestId. The same value is in the X-Request-Id response header. Pointed generates it. You cannot supply your own.
Pointed logs each write request with its request ID. Include the ID when you contact Pointed about a failed request.
Status codes
A 500 always carries the same text:
Error codes
meta.code is present only on some errors.
The setup and workspace routes use their own codes. See Workspace and setup.
Errors that carry data
An error can include adata object with what you need to recover. Creating a contact whose email already exists on the account returns the existing contact:
IDs, times and fields
- IDs are opaque strings. Do not parse them. A record’s ID is in
_id. - Times are numbers: milliseconds since 1 January 1970 UTC.
_creationTimeandcreatedAtboth use this form. Webhook event bodies use ISO 8601 text instead. See Webhooks. - Optional fields with no value are left out of a stored record. They are not sent as
null. - Extra fields. Many routes return the stored record. A response can contain fields that this reference does not list. Ignore them. They can change.
Limits
Pagination
Most list routes return the whole list. Four routes return pages:
A cursor is an opaque string. A page can be empty before the last page. Keep going until the route says it is done.
Retrying requests
There is no idempotency key for ordinary writes. These routes are safe to repeat:- Creating a contact twice returns 409 with the existing contact. No second contact is created.
- Creating links twice returns the same links, marked
"reused": true, while the earlier links are still valid. - Creating a webhook endpoint with an address the workspace already has returns 409.
domain. A domain can belong to one account only, so the second request returns 400.
Smart intake previews, setup tasks and workspace creation take a request key of their own. See their pages.
A typical integration
This walk-through invites one person at a customer account to an interview and learns when they finish. It uses these values: the account Acme, the contact Sarah Lee, your own user IDcus_8231 for her, and the link label user_8231.
1. Check the credential
data.orgName is the workspace the credential acts in. data.scopes must include pointed:read and pointed:write for the steps below.
2. Find or create the account
List the accounts and look for the one you want byname or domain.
data._id. It is the account ID.
3. Create the contact with your own ID
data._id. It is the contact ID. If the response is 409, the contact already exists and its ID is in data.contact._id.
To check first, look the person up by your own ID:
4. Find the account’s interviews
A campaign is the set of interviews for one account._id of the campaign you want. If the list is empty, enroll the account in a story template. Enrollment creates the account’s campaign.
5. Create a link with a reference
data.results has a surveyUrl to give to the person and an inviteId. Creating a link does not send an email. Send the link yourself, or use the invite email routes.
6. Register a webhook endpoint
data.secret. It is shown once. This step needs a credential that belongs to a workspace admin. You only do it once per endpoint.
Register the endpoint before the person takes the interview. An endpoint receives only events that happen while it is on.
7. Receive interview.completed
When Sarah finishes the interview, Pointed posts an interview.completed event to your endpoint. You can match it to your own records in three ways:
data.interview.idis theinviteIdfrom step 5.data.invite.referenceisuser_8231.data.contact.external_idiscus_8231.