---
title: "Pull messages from the server"
slug: "pull-messages-from-the-server"
updated: 2024-03-26T16:37:23Z
published: 2024-03-26T16:37:23Z
canonical: "help.rapididentity.com/pull-messages-from-the-server"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://help.rapididentity.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Pull messages from the server
Post/v2/tenants/{tenantId}/projects/{projectId}/subscriptions/{sub}:pull
Pull certain number of messages from the server.
SecurityAPI KeyHeader parameter nameAuthorization
AWS Cognito Authorizer. Since there are no custom scopes the ID Token must be used for authorization
Header parametersContent-TypestringRequired
Path parameterstenantIdstringRequired
The RapidIdentity Cloud tenant id
projectIdstringRequired
The project id this service belongs (i.e. sm, idhub, ric)
substringRequired
The queue name.
Body parameters
The number of messages to pull from the queue.
maxMessagesExample
Retrieving up to 5 messages from queue
```json
{
"maxMessages": 5
}
```
objectmaxMessagesinteger Required
The maximum number of messages to return from this request. Must be a positive integer. The Pub/Sub system may return fewer than the number specified
Responses200
An array of messages
HeadersContent-Typestring
Content-Lengthstring
Cache-Controlstring
Expand AllobjectreceivedMessages Array of object (ReceivedMessage)
The messages that were received
objectackIdstring
Optional. This ID can be used to acknowledge the received message.
messageobject (PubsubMessage)datastring (bytes)
Optional. The message data. If this field is empty, the message must contain at least one attribute
A base64-encoded string
attributesobject
Optional. Metadata attributes for this message. If this field is empty, the message must contain non-empty data
messageIdstring
Optional. ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value must not be populated by the publisher. Read-Only
publishTimestring (Timestamp)
Optional. The time at which the message was published, populated by the server when the message is published. Read-Only
400
An issue with how the request was formatted
HeadersContent-Typestring
Content-Lengthstring
Cache-Controlstring
Expand Allobjecterrorobject
The error message description
errors Array of object
The more detailed information about the error message
objectdomainstring
The service where the error occured. i.e. sm, idhub
reasonstring
The reason for the error based on Identity Automation common error codes
messagestring
Additional details about the error
locationTypestring
The specific location where the error occurred. i.e. parameter, content
locationstring
The higher level location of what was trying to be accessed. i.e. pullMessages, publishMessage
codestring
The http status code
messagestring
Additional details about the error
401
The request is not authorized. Ensure you are using an ID Token in your request and it is not expired
HeadersContent-Typestring
Content-Lengthstring
Cache-Controlstring
Expand Allobjecterrorobject
The error message description
errors Array of object
The more detailed information about the error message
objectdomainstring
The service where the error occured. i.e. sm, idhub
reasonstring
The reason for the error based on Identity Automation common error codes
messagestring
Additional details about the error
locationTypestring
The specific location where the error occurred. i.e. parameter, content
locationstring
The higher level location of what was trying to be accessed. i.e. pullMessages, publishMessage
codestring
The http status code
messagestring
Additional details about the error
403
The authorization token does not have access to the RapidIdentity Cloud Tenant. Ensure the tenantId used for authentication is the same one used in this request.
HeadersContent-Typestring
Content-Lengthstring
Cache-Controlstring
Expand Allobjecterrorobject
The error message description
errors Array of object
The more detailed information about the error message
objectdomainstring
The service where the error occured. i.e. sm, idhub
reasonstring
The reason for the error based on Identity Automation common error codes
messagestring
Additional details about the error
locationTypestring
The specific location where the error occurred. i.e. parameter, content
locationstring
The higher level location of what was trying to be accessed. i.e. pullMessages, publishMessage
codestring
The http status code
messagestring
Additional details about the error
404
The requested operation failed because a resource associated with the request could not be found
HeadersContent-Typestring
Content-Lengthstring
Cache-Controlstring
Expand Allobjecterrorobject
The error message description
errors Array of object
The more detailed information about the error message
objectdomainstring
The service where the error occured. i.e. sm, idhub
reasonstring
The reason for the error based on Identity Automation common error codes
messagestring
Additional details about the error
locationTypestring
The specific location where the error occurred. i.e. parameter, content
locationstring
The higher level location of what was trying to be accessed. i.e. pullMessages, publishMessage
codestring
The http status code
messagestring
Additional details about the error
405
The operation must be included and it must be pull
Expand Allobjecterrorobject
The error message description
errors Array of object
The more detailed information about the error message
objectdomainstring
The service where the error occured. i.e. sm, idhub
reasonstring
The reason for the error based on Identity Automation common error codes
messagestring
Additional details about the error
locationTypestring
The specific location where the error occurred. i.e. parameter, content
locationstring
The higher level location of what was trying to be accessed. i.e. pullMessages, publishMessage
codestring
The http status code
messagestring
Additional details about the error
503
Unable to connect to pubsub service
HeadersContent-Typestring
Content-Lengthstring
Cache-Controlstring
Expand Allobjecterrorobject
The error message description
errors Array of object
The more detailed information about the error message
objectdomainstring
The service where the error occured. i.e. sm, idhub
reasonstring
The reason for the error based on Identity Automation common error codes
messagestring
Additional details about the error
locationTypestring
The specific location where the error occurred. i.e. parameter, content
locationstring
The higher level location of what was trying to be accessed. i.e. pullMessages, publishMessage
codestring
The http status code
messagestring
Additional details about the error