zulip/api_docs/create-scheduled-message.md
Lauryn Menard 47a4d8900d api-docs: Update placeholder for curl user basic auth credentials.
Updates the placeholder in the curl examples of the API docs for
the user authentication line (-u) to be EMAIL_ADDRESS:API_KEY.

Adds text to the top of the curl tab about the user authentication
line with links to the curl man doc and the authorization header
section of the HTTP headers article.

If the endpoint does not have the user auth line (e.g., fetching
an API key in dev and production), then the text is not added to
the curl tab.

Fixes #479.
2026-02-26 10:18:12 -08:00

1.3 KiB

{generate_api_header(/scheduled_messages:post)}

Usage examples

{start_tabs}

{generate_code_example(python)|/scheduled_messages:post|example}

{generate_code_example(javascript)|/scheduled_messages:post|example}

{tab|curl}

{!curl-auth-credentials.md!}

# Create a scheduled channel message
curl -X POST {{ api_url }}/v1/scheduled_messages \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode type=stream \
    --data-urlencode to=9 \
    --data-urlencode topic=Hello \
    --data-urlencode 'content=Nice to meet everyone!' \
    --data-urlencode scheduled_delivery_timestamp=3165826990

# Create a scheduled direct message
curl -X POST {{ api_url }}/v1/messages \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode type=direct \
    --data-urlencode 'to=[9, 10]' \
    --data-urlencode 'content=Can we meet on Monday?' \
    --data-urlencode scheduled_delivery_timestamp=3165826990

{end_tabs}

Parameters

{generate_api_arguments_table|zulip.yaml|/scheduled_messages:post}

{generate_parameter_description(/scheduled_messages:post)}

Response

{generate_return_values_table|zulip.yaml|/scheduled_messages:post}

{generate_response_description(/scheduled_messages:post)}

Example response(s)

{generate_code_example|/scheduled_messages:post|fixture}