LateLate API
Utilities

Queue


Get queue schedules for a profile

Retrieve queue schedules for a profile. Each profile can have multiple queues.

  • Without all=true: Returns the default queue (or specific queue if queueId provided)
  • With all=true: Returns all queues for the profile
GET
/v1/queue/slots
AuthorizationBearer <token>

API key authentication - use your Late API key as a Bearer token

In: header

Query Parameters

profileIdstring

Profile ID to get queues for

queueId?string

Specific queue ID to retrieve (optional)

all?string

Set to 'true' to list all queues for the profile

Value in"true"

Response Body

application/json

application/json

curl -X GET "https://getlate.dev/api/v1/queue/slots?profileId=string"

{
  "exists": true,
  "schedule": {
    "_id": "64f0a1b2c3d4e5f6a7b8c9d1",
    "profileId": "64f0a1b2c3d4e5f6a7b8c9d0",
    "name": "Morning Posts",
    "timezone": "America/New_York",
    "slots": [
      {
        "dayOfWeek": 1,
        "time": "09:00"
      },
      {
        "dayOfWeek": 3,
        "time": "09:00"
      },
      {
        "dayOfWeek": 5,
        "time": "10:00"
      }
    ],
    "active": true,
    "isDefault": true
  },
  "nextSlots": [
    "2024-11-04T09:00:00-05:00",
    "2024-11-06T09:00:00-05:00"
  ]
}

Empty
{
  "error": "Unauthorized"
}
Empty

Create a new queue for a profile

Create an additional queue for a profile. The first queue created becomes the default. Subsequent queues are non-default unless explicitly set.

POST
/v1/queue/slots
AuthorizationBearer <token>

API key authentication - use your Late API key as a Bearer token

In: header

profileIdstring

Profile ID

namestring

Queue name (e.g., Evening Posts)

timezonestring

IANA timezone

slots
active?boolean
Defaulttrue

Response Body

application/json

application/json

curl -X POST "https://getlate.dev/api/v1/queue/slots" \  -H "Content-Type: application/json" \  -d '{    "profileId": "64f0a1b2c3d4e5f6a7b8c9d0",    "name": "Evening Posts",    "timezone": "America/New_York",    "slots": [      {        "dayOfWeek": 1,        "time": "18:00"      },      {        "dayOfWeek": 3,        "time": "18:00"      },      {        "dayOfWeek": 5,        "time": "18:00"      }    ],    "active": true  }'
{
  "success": true,
  "schedule": {
    "_id": "string",
    "profileId": "string",
    "name": "string",
    "timezone": "string",
    "slots": [
      {
        "dayOfWeek": 6,
        "time": "string"
      }
    ],
    "active": true,
    "isDefault": true,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "nextSlots": [
    "2019-08-24T14:15:22Z"
  ]
}
Empty
{
  "error": "Unauthorized"
}
Empty

Delete a queue schedule

Delete a queue from a profile. Requires queueId to specify which queue to delete. If deleting the default queue, another queue will be promoted to default.

DELETE
/v1/queue/slots
AuthorizationBearer <token>

API key authentication - use your Late API key as a Bearer token

In: header

Query Parameters

profileIdstring
queueIdstring

Queue ID to delete

Response Body

application/json

application/json

curl -X DELETE "https://getlate.dev/api/v1/queue/slots?profileId=string&queueId=string"
{
  "success": true,
  "deleted": true
}
Empty
{
  "error": "Unauthorized"
}

Create or update a queue schedule

Create a new queue or update an existing one.

  • Without queueId: Creates or updates the default queue
  • With queueId: Updates the specific queue
  • With setAsDefault=true: Makes this queue the default for the profile
PUT
/v1/queue/slots
AuthorizationBearer <token>

API key authentication - use your Late API key as a Bearer token

In: header

profileIdstring
queueId?string

Queue ID to update (optional)

name?string

Queue name

timezonestring
slots
active?boolean
Defaulttrue
setAsDefault?boolean

Make this queue the default

reshuffleExisting?boolean

Whether to reschedule existing queued posts to match new slots

Defaultfalse

Response Body

application/json

application/json

curl -X PUT "https://getlate.dev/api/v1/queue/slots" \  -H "Content-Type: application/json" \  -d '{    "profileId": "64f0a1b2c3d4e5f6a7b8c9d0",    "queueId": "64f0a1b2c3d4e5f6a7b8c9d1",    "name": "Morning Posts",    "timezone": "America/New_York",    "slots": [      {        "dayOfWeek": 1,        "time": "09:00"      },      {        "dayOfWeek": 3,        "time": "09:00"      },      {        "dayOfWeek": 5,        "time": "10:00"      }    ],    "active": true,    "setAsDefault": false  }'
{
  "success": true,
  "schedule": {
    "_id": "64f0a1b2c3d4e5f6a7b8c9d1",
    "profileId": "64f0a1b2c3d4e5f6a7b8c9d0",
    "name": "Morning Posts",
    "timezone": "America/New_York",
    "slots": [
      {
        "dayOfWeek": 1,
        "time": "09:00"
      },
      {
        "dayOfWeek": 3,
        "time": "09:00"
      },
      {
        "dayOfWeek": 5,
        "time": "10:00"
      }
    ],
    "active": true,
    "isDefault": true
  },
  "nextSlots": [
    "2024-11-04T09:00:00-05:00",
    "2024-11-06T09:00:00-05:00"
  ],
  "reshuffledCount": 0
}
Empty
{
  "error": "Unauthorized"
}
Empty

Preview upcoming queue slots for a profile

GET
/v1/queue/preview
AuthorizationBearer <token>

API key authentication - use your Late API key as a Bearer token

In: header

Query Parameters

profileIdstring
count?integer
Default20
Range1 <= value <= 100

Response Body

application/json

application/json

curl -X GET "https://getlate.dev/api/v1/queue/preview?profileId=string"
{
  "profileId": "64f0a1b2c3d4e5f6a7b8c9d0",
  "count": 10,
  "slots": [
    "2024-11-04T09:00:00-05:00",
    "2024-11-04T14:00:00-05:00",
    "2024-11-06T09:00:00-05:00",
    "2024-11-08T10:00:00-05:00",
    "2024-11-11T09:00:00-05:00",
    "2024-11-11T14:00:00-05:00",
    "2024-11-13T09:00:00-05:00",
    "2024-11-15T10:00:00-05:00",
    "2024-11-18T09:00:00-05:00",
    "2024-11-18T14:00:00-05:00"
  ]
}
Empty
{
  "error": "Unauthorized"
}
Empty

Preview the next available queue slot (informational only)

Returns the next available queue slot for preview/informational purposes.

Important: To schedule a post to the queue, do NOT use this endpoint's response with scheduledFor. That creates a manual post, not a queue post.

Instead, use POST /v1/posts with queuedFromProfile (and optionally queueId). The system will automatically assign the next available slot with proper locking to prevent race conditions.

This endpoint is useful for:

  • Showing users when their next post will go out before they commit
  • Debugging/verifying queue configuration
  • Building UI previews

If no queueId is specified, uses the profile's default queue.

GET
/v1/queue/next-slot
AuthorizationBearer <token>

API key authentication - use your Late API key as a Bearer token

In: header

Query Parameters

profileIdstring
queueId?string

Specific queue ID (optional, defaults to profile's default queue)

Response Body

application/json

application/json

curl -X GET "https://getlate.dev/api/v1/queue/next-slot?profileId=string"
{
  "profileId": "64f0a1b2c3d4e5f6a7b8c9d0",
  "nextSlot": "2024-11-04T09:00:00-05:00",
  "timezone": "America/New_York",
  "queueId": "64f0a1b2c3d4e5f6a7b8c9d1",
  "queueName": "Morning Posts"
}
Empty
{
  "error": "Unauthorized"
}
Empty