Authentication
Authenticated Tailwind REST API endpoints use bearer authentication. For server-side integrations, include a Tailwind API key in the Authorization header. Public endpoints such as /health and /openapi.json do not require authentication.
Getting Your API Key
Section titled “Getting Your API Key”- Log in to Tailwind
- Navigate to Settings > API Access
- Click Create API Key
- Copy your key and store it securely
Using Your API Key
Section titled “Using Your API Key”Include your API key in the Authorization header as a Bearer token:
curl -X GET https://api-v1.tailwind.ai/v1/accounts \ -H "Authorization: Bearer YOUR_API_KEY"JavaScript Example
Section titled “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();Tailwind API keys start with tw_pk_. OAuth access tokens issued by Tailwind are also accepted as bearer tokens; OAuth is primarily used by supported MCP clients.
Python Example
Section titled “Python Example”import requestsimport 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
Section titled “Environment Variables”We recommend storing your API key in environment variables:
# .env (add to .gitignore!)TAILWIND_API_KEY=your_api_key_hereError Responses
Section titled “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
Authorizationheader - Incorrect API key
- API key revoked in settings
API Key Permissions
Section titled “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
Section titled “Revoking API Keys”To revoke an API key:
- Go to Settings > API Access
- Find the key you want to revoke
- Click Revoke
The key will be immediately invalidated and any requests using it will fail.
