---
title: "Compose a message"
method: POST
path: "/v3/grants/{grant_id}/messages/smart-compose"
tags: ["Smart compose"]
---

# Compose a message

`POST /v3/grants/{grant_id}/messages/smart-compose`

Generates a message based on a prompt.

## Request body

- object — A Smart Compose request.
  - `prompt` string — The prompt that Smart Compose uses to generate a message suggestion.

## Response `200`

Returns a suggestion for a message

- object
  - `request_id` string — The request ID.
  - `data` object — The response object.
    - `suggestion` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `422` — Validation Error
- `500` — Unexpected Error

---

[API](https://skmtc.dev/nylas/apis/nylas-api.md) · [All operations](https://skmtc.dev/nylas/apis/nylas-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nylas/nylas-api/revisions/51c2c1b4ecff/schema)
