API Access
Use the Tona API to create instructions and manage your project programmatically.
API Access
Tona provides a simple REST API so you can create instructions and retrieve project information programmatically. This is useful if you want to integrate Tona into your own workflows, scripts, or third-party tools.
Finding Your API Credentials
- Go to your project and click Manual in the sidebar.
- Click the Use API link in the top-right corner of the page.
- You will see your API Key, Base URL, and Authorization Header.
Your API key is unique to each project. Keep it private and do not share it publicly.
Available Endpoints
Get Project Info
Retrieve your project's details, including name, description, credits, and connected platform accounts.
Request:
GET /v1/project
Authorization: Bearer <your-api-key>Create an Instruction
Send a new instruction to Tona, just like you would from the dashboard. Specify which platforms to post to, the content prompt, and optionally attach images.
Request:
POST /v1/instructions
Authorization: Bearer <your-api-key>
Content-Type: application/json
{
"platformAccountIds": ["<account-id>"],
"content": "Post a tweet about our new product launch",
"images": ["https://example.com/image.webp"]
}You can find your platform account IDs by calling the Get Project endpoint.
Copying as Markdown
On the API page, click Copy as Markdown to copy the full API documentation, including your actual API key, to your clipboard. This is handy when you want to paste the details into your own notes or share them with a developer on your team.
Tips
- Keep your API key safe. Treat it like a password. If you think it has been compromised, reach out to support.
- Test with a single platform first. When integrating, start by targeting one platform account to make sure everything works before scaling up.