Files
netbird-docs/docs/api/retrieve-a-setup-key.api.mdx
2023-04-26 15:06:59 +02:00

50 lines
8.2 KiB
Plaintext

---
id: retrieve-a-setup-key
title: "Retrieve a Setup Key"
description: "Get information about a Setup Key"
sidebar_label: "Retrieve a Setup Key"
hide_title: true
hide_table_of_contents: true
api: {"description":"Get information about a Setup Key","tags":["Setup Keys"],"security":[{"BearerAuth":[]},{"TokenAuth":[]}],"parameters":[{"in":"path","name":"keyId","required":true,"schema":{"type":"string"},"description":"The unique identifier of a setup key"}],"responses":{"200":{"description":"A Setup Key object","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Setup Key ID","type":"string"},"key":{"description":"Setup Key value","type":"string"},"name":{"description":"Setup key name identifier","type":"string"},"expires":{"description":"Setup Key expiration date","type":"string","format":"date-time"},"type":{"description":"Setup key type, one-off for single time usage and reusable","type":"string"},"valid":{"description":"Setup key validity status","type":"boolean"},"revoked":{"description":"Setup key revocation status","type":"boolean"},"used_times":{"description":"Usage count of setup key","type":"integer"},"last_used":{"description":"Setup key last usage date","type":"string","format":"date-time"},"state":{"description":"Setup key status, \"valid\", \"overused\",\"expired\" or \"revoked\"","type":"string"},"auto_groups":{"description":"Setup key groups to auto-assign to peers registered with this key","type":"array","items":{"type":"string"}},"updated_at":{"description":"Setup key last update date","type":"string","format":"date-time"},"usage_limit":{"description":"A number of times this key can be used. The value of 0 indicates the unlimited usage.","type":"integer"}},"required":["id","key","name","expires","type","valid","revoked","used_times","last_used","state","auto_groups","updated_at","usage_limit"],"title":"SetupKey"}}}},"400":{"description":"Bad Request","content":{}},"401":{"description":"Requires authentication","content":{}},"403":{"description":"Forbidden","content":{}},"500":{"description":"Internal Server Error","content":{}}},"method":"get","path":"/api/setup-keys/{keyId}","servers":[{"url":"https://netbird.io","description":"Default server"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"TokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Prefix the value with \\\"Token\\\" to indicate the custom authorization type"}},"info":{"title":"NetBird REST API","description":"API to manipulate groups, rules, policies and retrieve information about peers and users","version":"0.0.1"},"postman":{"name":"Retrieve a Setup Key","description":{"content":"Get information about a Setup Key","type":"text/plain"},"url":{"path":["api","setup-keys",":keyId"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) The unique identifier of a setup key","type":"text/plain"},"type":"any","value":"","key":"keyId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET","auth":{"type":"bearer","bearer":[{"type":"any","value":"<Bearer Token>","key":"token"}]}}}
sidebar_class_name: "get api-method"
info_path: api/netbird-rest-api
custom_edit_url: null
---
import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
import ParamsItem from "@theme/ParamsItem";
import ResponseSamples from "@theme/ResponseSamples";
import SchemaItem from "@theme/SchemaItem";
import SchemaTabs from "@theme/SchemaTabs";
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
import TabItem from "@theme/TabItem";
## Retrieve a Setup Key
Get information about a Setup Key
<details style={{"marginBottom":"1rem"}} data-collapsed={false} open={true}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"in":"path","name":"keyId","required":true,"schema":{"type":"string"},"description":"The unique identifier of a setup key"}}></ParamsItem></ul></div></details><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
A Setup Key object
</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Setup Key ID","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"key"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Setup Key value","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Setup key name identifier","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"expires"} required={true} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Setup Key expiration date","type":"string","format":"date-time"}}></SchemaItem><SchemaItem collapsible={false} name={"type"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Setup key type, one-off for single time usage and reusable","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"valid"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Setup key validity status","type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"revoked"} required={true} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Setup key revocation status","type":"boolean"}}></SchemaItem><SchemaItem collapsible={false} name={"used_times"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"description":"Usage count of setup key","type":"integer"}}></SchemaItem><SchemaItem collapsible={false} name={"last_used"} required={true} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Setup key last usage date","type":"string","format":"date-time"}}></SchemaItem><SchemaItem collapsible={false} name={"state"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Setup key status, \"valid\", \"overused\",\"expired\" or \"revoked\"","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"auto_groups"} required={true} schemaName={"string[]"} qualifierMessage={undefined} schema={{"description":"Setup key groups to auto-assign to peers registered with this key","type":"array","items":{"type":"string"}}}></SchemaItem><SchemaItem collapsible={false} name={"updated_at"} required={true} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Setup key last update date","type":"string","format":"date-time"}}></SchemaItem><SchemaItem collapsible={false} name={"usage_limit"} required={true} schemaName={"integer"} qualifierMessage={undefined} schema={{"description":"A number of times this key can be used. The value of 0 indicates the unlimited usage.","type":"integer"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"key\": \"string\",\n \"name\": \"string\",\n \"expires\": \"2023-04-26T12:12:56.627Z\",\n \"type\": \"string\",\n \"valid\": true,\n \"revoked\": true,\n \"used_times\": 0,\n \"last_used\": \"2023-04-26T12:12:56.627Z\",\n \"state\": \"string\",\n \"auto_groups\": [\n \"string\"\n ],\n \"updated_at\": \"2023-04-26T12:12:56.627Z\",\n \"usage_limit\": 0\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
Bad Request
</div><div></div></TabItem><TabItem label={"401"} value={"401"}><div>
Requires authentication
</div><div></div></TabItem><TabItem label={"403"} value={"403"}><div>
Forbidden
</div><div></div></TabItem><TabItem label={"500"} value={"500"}><div>
Internal Server Error
</div><div></div></TabItem></ApiTabs></div>