# sendInstagramMessage

Reply by Instagram DM to the contact's newest Instagram message, from the account they wrote to, as the key owner, within 24 hours of it. Needs the send consent attestation, like sendText. Sent exactly as written; text is at most 960 bytes. Returns ok, or refusal (NOT_ENABLED, NO_CONVERSATION, WINDOW_CLOSED, NOT_CONNECTED, EMPTY, TOO_LONG, SEND_FAILED: check the timeline before retrying).

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "sendInstagramMessage", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `contactId`: `ID!` (required)
- `text`: `String!` (required)

## Response (data, an example)

```json
{
  "contactMutation": {
    "sendContactInstagramMessage": {
      "ok": true,
      "refusal": "NOT_ENABLED"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "sendInstagramMessage",
    "variables": {
      "contactId": "<contactId>",
      "text": "<String>"
    }
  }'
```
