Skip to content

Messages

Service-owner messages can be displayed to consumers with active service items for the targeted services. Messages may include an expiry date and service scopes.

Accessed via client.messages.

Methods

create(data)

Creates a message through /v1/orcaexternal/{context}/messages/.

message = client.messages.create({
    "description": "Scheduled maintenance",
    "expiry_date": "2026-09-30T12:00:00.000Z",
    "scopes": [],
})

list(**filters)

Lists messages with automatic pagination. Results are returned as Message models.

for message in client.messages.list():
    print(message.id, message.description)

get(message_id)

Retrieves one message as a Message model.

message = client.messages.get(message_id=7)

update(message_id, data, partial=True)

Updates a message using PATCH by default, or PUT when partial=False. For partial updates, the SDK preserves the existing scopes when they are not included in data, converting the nested scope objects returned by the API into service URLs accepted by the write endpoint. This avoids clearing the message audience or sending an invalid PATCH request.

client.messages.update(message_id=7, data={"description": "Updated maintenance notice"})

delete(message_id)

Deletes a message by ID.

client.messages.delete(message_id=7)