API Quickstart
Plain's API gives your team access to the same powerful tools our own product is built on. Whether you want to connect customer data, build automations, or extend your workflows, Plain's API makes it possible.
This guide will walk you through the basics of Plain's API and what you'll need to get started.
If you are new to GraphQL, Apollo has resources for beginners. The official GraphQL documentation is another good starting point.
What you'll need to get started
Here's what someone on your team will need to get started with our API:
Your API key: This gives your system permission to talk to Plain. You can generate one from Settings → API Keys in your Plain workspace.
A GraphQL client or script: Your team might use a tool like Postman, curl, or a GraphQL IDE.
The API endpoint:
Basic headers (for every request):
The GraphQL schema (optional):
URL:
https://core-api.uk.plain.com/graphql/v1Content-Type: application/jsonAuthorization: Bearer YOUR_API_KEYYour team can download it here:
https://core-api.uk.plain.com/graphql/v1/schema.graphql
What kind of things can you do with it?
Here are some examples of what your team can build using Plain's API:
Pull a list of your customers and display it in another internal tool
Upsert customer records into Plain from your product
Pull core details like usage, billing info, plan type into Customer Cards
Automatically create a note or label a customer thread when a status changes in your CRM
Fetch conversation data for reporting in tools like Retool or Looker
Tip: A great way to explore what you can use our API for is to open our API explorer (which requires setting up a Plain workspace).
Making your first API call
Here's a real-world example you might start with:
"Find a customer in Plain using their email address."
To do this, you'll need an API key with the customer:read permission. Here's what that call looks like using curl:
curl https://core-api.uk.plain.com/graphql/v1 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"query":"query($email: String!) { customerByEmail(email: $email) { id fullName email { email } } }","variables":{"email":"user@example.com"}}'
If you prefer TypeScript or Node.js, Plain provides @team-plain/graphql on npm, which gives you full typed coverage of the API.
Not sure where to start?
If you're curious about how Plain's API could work for your team, or you want help scoping a specific use case, just reach out to us. We're happy to walk through ideas, examples, or even build with you.