# Courier Messaging API Publish, consume, and acknowledge messages on Anypoint MQ destinations. Manage message locks and delivery. - **Version:** 1.0.0 - **Category:** Messaging - **OpenAPI Spec:** [api.yaml](https://dev-portal.mulesoft.com/apis/anypoint-mq-broker/api.yaml) ## Servers - `http://mq-{REGION_ID}.anypoint.mulesoft.com/api/{version}` - `https://mq-{REGION_ID}.anypoint.mulesoft.com/api/{version}` ## Operations (10) ### GET /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages **Operation ID:** `getOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessages` Requests messages from the destination. If you are using connected app, "Destination subscriber for given environment" scope is needed. **Parameters:** | `pollingTime` | query | Maximum time in milliseconds to wait for the expected message or messages. | optional | | `batchSize` | query | Maximum number of messages to receive in a single call. When set as 1, the response is an array containing only one element. | optional | | `lockTtl` | query | Defines the time to live of the created locks in milliseconds. | optional | | `payloadVisibility` | query | Decides whether to show or hide message payload in response | optional | | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### PUT /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages **Operation ID:** `updateOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessages` Publishes a batch of messages to the destination. Batch size must be at least 1 and at most 10. If you are using connected app, "Destination publisher for given environment" scope is needed. **Parameters:** | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### DELETE /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages **Operation ID:** `deleteOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessages` Acknowledge a batch of messages. If you are using connected app, "Destination subscriber for given environment" scope is needed. **Parameters:** | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### PATCH /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages/locks **Operation ID:** `patchOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessagesLocks` Modifies the lock TTL of a batch of messages. If you are using connected app, "Destination publisher for given environment" scope is needed. **Parameters:** | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### DELETE /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages/locks **Operation ID:** `deleteOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessagesLocks` Performs a batch negative acknowledge of messages. These are available again for this or other consumers. If you are using connected app, "Destination subscriber for given environment" scope is needed. **Parameters:** | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### PUT /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages/{messageId} **Operation ID:** `updateOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessagesByMessageid` Sends the message to the specified destination. If you are using connected app, "Destination publisher for given environment" scope is needed. **Parameters:** | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | | `messageId` | query | Unique identifier for the message | required | ### DELETE /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages/{messageId} **Operation ID:** `deleteOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessagesByMessageid` Performs an acknowledge of the message, effectively deleting it from the destination. If you are using connected app, "Destination subscriber for given environment" scope is needed. **Parameters:** | `organizationId` | query | The organization ID to identify the target resource. | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | | `messageId` | query | Unique identifier for the message | required | ### PATCH /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages/{messageId}/locks/{lockId} **Operation ID:** `patchOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessagesByMessageidLocksByLockid` Modifies the lock TTL. Typically occurs when the default TTL is not long enough to perform a particular operation. If you are using connected app, "Destination publisher for given environment" scope is needed. **Parameters:** | `lockId` | query | Identificator of a lock. | required | | `messageId` | query | Unique identifier for the message | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### DELETE /organizations/{organizationId}/environments/{environmentId}/destinations/{destinationId}/messages/{messageId}/locks/{lockId} **Operation ID:** `deleteOrganizationsByOrganizationidEnvironmentsByEnvironmentidDestinationsByDestinationidMessagesByMessageidLocksByLockid` Performs a negative acknowledge of the message. The message is available again for this or other consumers. If you are using connected app, "Destination subscriber for given environment" scope is needed. **Parameters:** | `lockId` | query | Identificator of a lock. | required | | `messageId` | query | Unique identifier for the message | required | | `environmentId` | query | The environment ID to identify the target resource. | required | | `organizationId` | query | The organization ID to identify the target resource. | required | | `destinationId` | query | Identifier of a destination. | required | ### POST /authorize **Operation ID:** `createAuthorize` Obtains an access token using client credentials of the OAuth grant type. This API is not supported with connectedApp.