---
type: api
title: "Receive a provisioning callback"
description: "Called by the deployment launched from Kibana to report what it created. The request is not authenticated: present the one-time token issued when the callback was created in the x-elastic-callback-token header. The token is not an Elasticsearch credential and admits nothing but this report. The body is shaped for the record's cloud provider and carries origin_proof, the provider's proof that the report was sent from the account of what it reports, bound to this callback and these values; a report whose proof does not verify returns 401 and leaves the record waiting. A deployment launched from a blueprint that sends the proof (for AWS, aws/workload_identity_federation 1.5.0 and later, as recorded on the callback at launch) must send it, and a report without one is a 400; a deployment launched before that may still report without it. For AWS, the CloudFormation stack's Lambda reports role_arn and stack_arn, which must be in the same account, and the proof is an STS GetCallerIdentity request signed from that account with the callback id and the SHA-256 of the reported values among its signed headers; Kibana forwards it to sts.<region>.amazonaws.com, so it needs egress to the regional STS endpoints. The signer must also be named as the stack's callback function and its role would be, which only turns away a stray principal: anyone in the account can pick those names, so the account is what the proof establishes. While the record is pending, a repeat report with the same values succeeds and different values return 409; an expired or cancelled record returns 410."
url: https://www.elastic.co/elastic/docs-builder/docs/4904/api/kibana-serverless/operation/operation-receive-provisioning-callback
resource: https://www.elastic.co/elastic/docs-builder/docs/4904/api/kibana-serverless/operation/operation-receive-provisioning-callback
products:
  - Kibana
---

# Receive a provisioning callback

Authentication: required

Availability: Experimental

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/fleet/iac_provisioner/callbacks/{callbackId}`
- `POST` `/s/{space_id}/api/fleet/iac_provisioner/callbacks/{callbackId}`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `callbackId` (string · min length: 1 · max length: 128) — required
  ID of the callback record, as issued to the launched deployment.

## Description

Called by the deployment launched from Kibana to report what it created. The request is not authenticated: present the one-time token issued when the callback was created in the `x-elastic-callback-token` header. The token is not an Elasticsearch credential and admits nothing but this report. The body is shaped for the record's cloud provider and carries `origin_proof`, the provider's proof that the report was sent from the account of what it reports, bound to this callback and these values; a report whose proof does not verify returns 401 and leaves the record waiting. A deployment launched from a blueprint that sends the proof (for AWS, `aws/workload_identity_federation` 1.5.0 and later, as recorded on the callback at launch) must send it, and a report without one is a 400; a deployment launched before that may still report without it. For AWS, the CloudFormation stack's Lambda reports `role_arn` and `stack_arn`, which must be in the same account, and the proof is an STS `GetCallerIdentity` request signed from that account with the callback id and the SHA-256 of the reported values among its signed headers; Kibana forwards it to `sts.<region>.amazonaws.com`, so it needs egress to the regional STS endpoints. The signer must also be named as the stack's callback function and its role would be, which only turns away a stray principal: anyone in the account can pick those names, so the account is what the proof establishes. While the record is pending, a repeat report with the same values succeeds and different values return 409; an expired or cancelled record returns 410.

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Request body

`application/json`

- `origin_proof` (object) — optional
  The proof that the report was sent from the account of the reported role and stack: a signed STS `GetCallerIdentity` request, made by the callback function with the callback id and the SHA-256 of the reported values among its signed headers. Kibana forwards it to the regional STS endpoint; whoever answers identifies the signer. Optional while stacks launched before the proof was sent can still report.
  - `body` (enum) — required
    The signed request body.
    Values: `Action=GetCallerIdentity&Version=2011-06-15`
  - `headers` (map string to string) — required
    The signed request headers: `Authorization`, `X-Amz-Date`, `X-Amz-Security-Token`, `Content-Type`, and the signed `x-elastic-callback-id` and `x-elastic-report-sha256` headers that bind the proof to this record and this report.
    Map values (string · max length: 8192)
  - `region` (string · min length: 1 · max length: 32) — required
    Region of the STS endpoint the request was signed for.
- `role_arn` (string · min length: 1 · max length: 2048) — required
  ARN of the IAM role the stack created.
- `stack_arn` (string · min length: 1 · max length: 2048) — required
  ARN (StackId) of the CloudFormation stack.

## Responses

#### `200`

The values were stored, or were already stored

`application/json`

- `status` (enum)
  State of the callback record. `pending`: waiting for the deployment. `receiving`: a report is being applied. `received`: values stored and the identity exists. `cancelled`: the form stopped waiting and the token is refused.
  Values: `pending`, `receiving`, `received`, `cancelled`
#### `400`

Bad Request

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
#### `401`

Unauthorized

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
#### `404`

Not Found

`application/json`

- `message` (string)
#### `409`

Conflict

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
#### `410`

Gone

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
POST kbn:/api/fleet/iac_provisioner/callbacks/CALLBACK_ID
{
  "origin_proof": {
    "body": "Action=GetCallerIdentity\u0026Version=2011-06-15",
    "headers": {
      "Authorization": "AWS4-HMAC-SHA256 Credential=ASIAEXAMPLE/20261113/us-east-1/sts/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-security-token;x-elastic-callback-id;x-elastic-report-sha256, Signature=5d41402abc4b2a76b9719d911017c592e5c0c8d3b0d4c3d6b0b1e0d8f9a1b2c3",
      "Content-Type": "application/x-www-form-urlencoded",
      "X-Amz-Date": "20261113T100000Z",
      "X-Amz-Security-Token": "IQoJb3JpZ2luX2VjEXAMPLE",
      "x-elastic-callback-id": "0f5d7a5e-2b1c-4a3d-9e8f-123456789abc",
      "x-elastic-report-sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
    },
    "region": "us-east-1"
  },
  "role_arn": "arn:aws:iam::123456789012:role/ElasticWorkloadIdentity-abc123",
  "stack_arn": "arn:aws:cloudformation:us-east-1:123456789012:stack/elastic-identity/11111111-2222-3333-4444-555555555555"
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/iac_provisioner/callbacks/${CALLBACK_ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "origin_proof": {
      "body": "Action=GetCallerIdentity\u0026Version=2011-06-15",
      "headers": {
        "Authorization": "AWS4-HMAC-SHA256 Credential=ASIAEXAMPLE/20261113/us-east-1/sts/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-security-token;x-elastic-callback-id;x-elastic-report-sha256, Signature=5d41402abc4b2a76b9719d911017c592e5c0c8d3b0d4c3d6b0b1e0d8f9a1b2c3",
        "Content-Type": "application/x-www-form-urlencoded",
        "X-Amz-Date": "20261113T100000Z",
        "X-Amz-Security-Token": "IQoJb3JpZ2luX2VjEXAMPLE",
        "x-elastic-callback-id": "0f5d7a5e-2b1c-4a3d-9e8f-123456789abc",
        "x-elastic-report-sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
      },
      "region": "us-east-1"
    },
    "role_arn": "arn:aws:iam::123456789012:role/ElasticWorkloadIdentity-abc123",
    "stack_arn": "arn:aws:cloudformation:us-east-1:123456789012:stack/elastic-identity/11111111-2222-3333-4444-555555555555"
  }'
```

## Response examples

#### Identity created

`application/json`

The report was applied and the federated identity exists

```json
{
  "status": "received"
}
```

#### Role and stack accounts differ

`application/json`

The role and the stack are in different AWS accounts

```json
{
  "error": "Bad Request",
  "message": "role_arn and stack_arn must be in the same AWS account",
  "statusCode": 400
}
```

#### Proof of the sending account did not verify

`application/json`

For AWS: STS did not vouch that the report was signed from the account and partition of the reported role, the signer is not named as the stack callback function, or the proof was made for another callback or other values

```json
{
  "error": "Unauthorized",
  "message": "The report was not signed from the account of what it reports",
  "statusCode": 401
}
```

#### Unknown callback or token

`application/json`

No record has this ID, or the token is not the one issued for it

```json
{
  "error": "Not Found",
  "message": "Callback not found",
  "statusCode": 404
}
```

#### Different values already received

`application/json`

A report with different values was already received

```json
{
  "error": "Conflict",
  "message": "Callback already received with different values",
  "statusCode": 409
}
```

#### Callback expired or cancelled

`application/json`

The record expired or was cancelled before the report arrived

```json
{
  "error": "Gone",
  "message": "Callback is no longer accepting values",
  "statusCode": 410
}
```

