---
id: api-key-read
title: "Read an API key"
description: "Reads an API key by ID."
sidebar_label: "Read an API key"
hide_title: true
hide_table_of_contents: true
api: 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
sidebar_class_name: "get api-method"
info_path: docs/api/authorization
custom_edit_url: null
---

import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
import ParamsDetails from "@theme/ParamsDetails";
import RequestSchema from "@theme/RequestSchema";
import StatusCodes from "@theme/StatusCodes";
import OperationTabs from "@theme/OperationTabs";
import TabItem from "@theme/TabItem";
import Heading from "@theme/Heading";

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Read an API key"}
>
</Heading>

<MethodEndpoint
  method={"get"}
  path={"/api_key/{id}"}
  context={"endpoint"}
>
  
</MethodEndpoint>



Reads an API key by ID.


<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"name":"id","in":"path","description":"The unique identifier for the API key.\n","required":true,"schema":{"type":"integer"},"example":1234}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={undefined}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"description":"The operation was successful.","content":{"application/json":{"schema":{"type":"object","required":["id","name","tags","grants","created_at","updated_at"],"properties":{"id":{"type":"integer","description":"Unique ID for the API key.","example":1234},"name":{"type":"string","description":"The descriptive name given to the API key.","example":"CI/CD Main"},"masked_api_key":{"type":"string","description":"Your masked API key.","example":"AAAA.xxxxxxxxxxxxxxxxxxxxxPTs=","nullable":true},"tags":{"type":"array","description":"Array of tags associated with your API key.\n\nℹ️ If no tags are found, we return an empty array.\n","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"Tag key associated with your API key.","example":"CI"},"value":{"type":"string","description":"Tag value associated with your API key.","example":"main"}}}},"grants":{"type":"array","description":"Defines access grants for an API key.","items":{"type":"object","required":["nrn","role_id","role_slug"],"properties":{"nrn":{"type":"string","description":"The NRN of the resource where the API key's role is assigned.","example":"organization=1:account=1:namespace=1:application=4"},"role_id":{"type":"integer","description":"The ID of the role assigned to the API key for this NRN.","example":1855672260},"role_slug":{"type":"string","description":"The slug of the role assigned to the API key for this NRN.","example":"machine:ci"}}}},"owner_id":{"type":"integer","description":"The unique ID of the user that creates the API key.","example":1595},"last_used_at":{"type":"string","description":"The ISO-8601 UTC timestamp of when the API key was last used.","nullable":true,"format":"date-time","example":"2021-01-02T00:00:00Z"},"created_at":{"type":"string","description":"The ISO-8601 UTC timestamp of when the API key was created.","format":"date-time","example":"2021-01-02T00:00:00Z"},"updated_at":{"type":"string","nullable":true,"description":"The ISO-8601 UTC timestamp of when the API key was last updated.","format":"date-time","example":"2021-01-02T00:00:00Z"}},"title":"apiKeyResponse"}}}},"4XX":{"description":"Client error responses due to invalid input or missing parameters.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific client error (e.g., 400, 401, 403, 404).","example":400},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"bad_request"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Bad Request\", \"Unauthorized\").","example":"Bad Request"},"message":{"type":"string","description":"Additional details about the error.","example":"The request was malformed or contained invalid parameters."}}}}}},"5XX":{"description":"Server error responses indicating an issue on the API side.","content":{"application/json":{"schema":{"type":"object","required":["statusCode","error","message"],"properties":{"statusCode":{"type":"integer","description":"HTTP status code representing the specific server error (e.g., 500, 502, 503).","example":500},"code":{"type":"string","description":"A machine-readable error code that categorizes the server failure.","example":"internal_server_error"},"error":{"type":"string","description":"A brief, human-readable description of the error type (e.g., \"Internal Server Error\", \"Service Unavailable\").","example":"Internal Server Error"},"message":{"type":"string","description":"Additional details about the error.","example":"An unexpected error occurred. Please try again later."}}}}}}}}
>
  
</StatusCodes>


      