Skip to content

Authentication

The Tailwind API uses bearer token authentication. You’ll need to include your API key in the Authorization header of every request.

Getting Your API Key

  1. Log in to Tailwind
  2. Navigate to Settings > API Access
  3. Click Create API Key
  4. Copy your key and store it securely

Using Your API Key

Include your API key in the Authorization header as a Bearer token:

Terminal window
curl -X GET https://api-v1.tailwind.ai/v1/accounts \
-H "Authorization: Bearer YOUR_API_KEY"

JavaScript Example

const response = await fetch('https://api-v1.tailwind.ai/v1/accounts', {
headers: {
'Authorization': `Bearer ${process.env.TAILWIND_API_KEY}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();

Python Example

import requests
import os
response = requests.get(
'https://api-v1.tailwind.ai/v1/accounts',
headers={
'Authorization': f'Bearer {os.environ["TAILWIND_API_KEY"]}',
'Content-Type': 'application/json'
}
)
data = response.json()

Environment Variables

We recommend storing your API key in environment variables:

Terminal window
# .env (add to .gitignore!)
TAILWIND_API_KEY=your_api_key_here

Error Responses

If authentication fails, you’ll receive a 401 Unauthorized response:

{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
},
"meta": {
"requestId": "abc123"
}
}

Common causes:

  • Missing Authorization header
  • Incorrect or expired API key
  • API key revoked in settings

API Key Permissions

API keys have full access to:

  • All Pinterest accounts in your organization
  • All boards and board lists
  • Creating, scheduling, and deleting posts
  • Viewing timeslots

Revoking API Keys

To revoke an API key:

  1. Go to Settings > API Access
  2. Find the key you want to revoke
  3. Click Revoke

The key will be immediately invalidated and any requests using it will fail.