> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://contentful.com/developers/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://contentful.com/developers/docs/_mcp/server.

# Get an AI action invocation

GET https://api.contentful.com/spaces/{space_id}/environments/{environment_id}/ai/actions/{ai_action_id}/invocations/{ai_action_invocation_id}

Use this endpoint to obtain the result of an AI Action Invocation for a specified space, environment, AI Action and Invocation.

Reference: https://contentful.com/developers/docs/references/content-management-api/ai-actions/get-an-ai-action-invocation

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `space_id` (string, required) — ID of the space in the form of a string
- `environment_id` (string, required) — ID of the environment in the form of a string
- `ai_action_id` (string, required) — ID of the AI Action in form of a string
- `ai_action_invocation_id` (string, required) — ID of the AI Action invocation in the form of a string

## Response

### 200

OK - Request successful

- `map from string to any`

## Examples

**Response**

```json
{
  "sys": {
    "aiAction": {
      "sys": {
        "id": "3D5GGn5FlhszToS2Sbkfk8",
        "linkType": "AiAction",
        "type": "Link"
      }
    },
    "environment": {
      "sys": {
        "id": "staging",
        "linkType": "Environment",
        "type": "Link"
      }
    },
    "id": "XgfOib1ayqA4Jl8GKIgUt",
    "result": {
      "content": "Dies ist ein Beispieltext",
      "metadata": {
        "invocationResult": {
          "modelId": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
          "modelProvider": "amazon-bedrock",
          "outputFormat": "PlainText",
          "wordCount": 4
        },
        "statusChangedDates": {
          "date": "2025-03-28T08:06:09.854Z",
          "status": "COMPLETED"
        }
      },
      "type": "text"
    },
    "space": {
      "sys": {
        "id": "yadj1kx9rmg0",
        "linkType": "Space",
        "type": "Link"
      }
    },
    "status": "COMPLETED",
    "type": "AiActionInvocation"
  }
}
```

**SDK Code**

```android Android
SDK currently doesn't implement this endpoint.
```

```java Java
SDK currently doesn't implement this endpoint.
```

```kotlin Kotlin
SDK currently doesn't implement this endpoint.
```

```swift Swift
We currently don't provide a CMA SDK for this platform.
```

```js-legacy JavaScript (legacy)
client.getSpace('<space_id>')
.then((space) => space.getEnvironment('<environment_id>'))
.then((environment) =>
  environment.getAiActionInvocation({ aiActionId: 'ai_action_id',invocationId:'ai_action_invocation_id' }))
.then((aiActionInvocation) => console.log(aiActionInvocation))
.catch(console.error)
```

```javascript JavaScript
client.aiActionInvocation.get({
  spaceId: '<space_id>',
  environmentId: '<environment_id>',
  aiActionId: '<ai_action_id>',
  invocationId: '<ai_action_invocation_id>'
});
```

```php PHP
SDK currently doesn't implement this endpoint.
```

```ruby Ruby
SDK currently doesn't implement this endpoint.
```

```python Python
SDK currently doesn't implement this endpoint.
```

```.net .NET
SDK currently doesn't implement this endpoint.
```