api.md: add info for key description (#8429)

Updates tailscale/corp#7773

Signed-off-by: Jenny Zhang <jz@tailscale.com>
pull/8360/head
phirework 1 year ago committed by GitHub
parent bfe5623a86
commit 2a9817da39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1222,6 +1222,11 @@ The remaining three methods operate on auth keys and API access tokens.
// expirySeconds (int) is the duration in seconds a new key is valid. // expirySeconds (int) is the duration in seconds a new key is valid.
"expirySeconds": 86400 "expirySeconds": 86400
// description (string) is an optional short phrase that describes what
// this key is used for. It can be a maximum of 50 alphanumeric characters.
// Hyphens and underscores are also allowed.
"description": "short description of key purpose"
} }
``` ```
@ -1308,6 +1313,9 @@ Note the following about required vs. optional values:
Specifies the duration in seconds until the key should expire. Specifies the duration in seconds until the key should expire.
Defaults to 90 days if not supplied. Defaults to 90 days if not supplied.
- **`description`:** Optional in `POST` body.
A short string specifying the purpose of the key. Can be a maximum of 50 alphanumeric characters. Hyphens and spaces are also allowed.
### Request example ### Request example
``` jsonc ``` jsonc
@ -1325,7 +1333,8 @@ curl "https://api.tailscale.com/api/v2/tailnet/example.com/keys" \
} }
} }
}, },
"expirySeconds": 86400 "expirySeconds": 86400,
"description": "dev access"
}' }'
``` ```
@ -1351,7 +1360,8 @@ It holds the capabilities specified in the request and can no longer be retrieve
"tags": [ "tag:example" ] "tags": [ "tag:example" ]
} }
} }
} },
"description": "dev access"
} }
``` ```
@ -1403,7 +1413,8 @@ The response is a JSON object with information about the key supplied.
] ]
} }
} }
} },
"description": "dev access"
} }
``` ```

Loading…
Cancel
Save