Skip to main content
POST
https://api-dev.weir.ai/
/
console
/
pax
curl -X POST 'https://api.weir.ai/console/pax' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'x-source: console' \
  -d '{
    "platformId": "platform_123456789",
    "name": "My PAX",
    "scopes": ["read", "write"]
  }'
{
  "data": {
    "paxId": "pax_123456789",
    "platformId": "platform_123456789",
    "name": "My PAX",
    "scopes": ["read", "write"],
    "status": "active",
    "createdAt": "2024-01-22T15:30:00Z"
  },
  "message": "PAX created successfully",
  "status": "success"
}

Create PAX

Create a new PAX (Platform Access Extension) for your platform.
curl -X POST 'https://api.weir.ai/console/pax' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -H 'x-source: console' \
  -d '{
    "platformId": "platform_123456789",
    "name": "My PAX",
    "scopes": ["read", "write"]
  }'
{
  "data": {
    "paxId": "pax_123456789",
    "platformId": "platform_123456789",
    "name": "My PAX",
    "scopes": ["read", "write"],
    "status": "active",
    "createdAt": "2024-01-22T15:30:00Z"
  },
  "message": "PAX created successfully",
  "status": "success"
}

Request Body

platformId
string
required
Platform ID to create PAX for.
name
string
required
PAX name.
scopes
array
required
Array of permission scopes.

Usage Examples

const createPax = async (paxData, accessToken) => {
  const response = await fetch('https://api.weir.ai/console/pax', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json',
      'x-source': 'console'
    },
    body: JSON.stringify(paxData)
  });
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return await response.json();
};