# Step

This endpoint is used to see the output for a job step.

### Entity fields:

| Path                       | Type   | Description                                                                              |
| -------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| data.type                  | string | Should be "step"                                                                         |
| data.attributes.output     | string | URL with the output for the step                                                         |
| data.attributes.status     | string | Step status(pending or completed)                                                        |
| data.attributes.stepNumber | int    | A job can have several steps, this field is used to identity the order for the execution |

### Example:

```
{
  "data": {
    "type": "step",
    "attributes": {
      "output": "URL with the step output",
      "stepNumber": "Step Number Order",
      "status": "Terraform Provider"
    }
  }
}
```

### Supported Operations

## GET /step/{stepId}

> Returns an instance of type step

```json
{"openapi":"3.0.1","info":{"title":"Elide Service","version":"0.0.1"},"tags":[{"name":"step"}],"servers":[{"url":"/api/v1"}],"paths":{"/step/{stepId}":{"get":{"tags":["step"],"description":"Returns an instance of type step","parameters":[{"name":"fields[step]","in":"query","description":"Selects the set of step fields that should be returned in the result.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["name","output","status","stepNumber","job"]}}},{"name":"include","in":"query","description":"Selects the set of relationships that should be expanded as a compound document in the result.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","enum":["job"]}}}],"responses":{"200":{"description":"Successful response","content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/step"},"included":{"uniqueItems":true,"type":"array","description":"Included resources","items":{"type":"object","properties":{"type":{"type":"string"},"id":{"type":"string"},"attributes":{"type":"object"},"relationships":{"type":"object"}}}}}}}}}}}}},"components":{"schemas":{"step":{"type":"object","properties":{"type":{"type":"string","description":""},"id":{"type":"string"},"attributes":{"type":"object","properties":{"name":{"type":"string","readOnly":false,"writeOnly":false},"output":{"type":"string","readOnly":false,"writeOnly":false},"status":{"type":"string","readOnly":false,"writeOnly":false,"enum":["pending","waitingApproval","approved","queue","running","completed","noChanges","notExecuted","rejected","cancelled","failed","unknown"]},"stepNumber":{"type":"integer","format":"int32","readOnly":false,"writeOnly":false}}},"relationships":{"type":"object","properties":{"job":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["job"]},"id":{"type":"string"}},"readOnly":false,"writeOnly":false}}}}}}}}}}}
```

{% hint style="info" %}
For a complete list of organization operation please visit the [OpenAPI specification](https://github.com/AzBuilder/terrakube-server/tree/main/openapi-spec)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/api/methods/step.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
