Import JWK File
Endpoint
POST /apiops/projects/{projectName}/jwks/import-file/
bilgi
This uploads the raw document. To restore a JWK from an Apinizer package, use the Import Objects endpoint with type CERTIFICATE.
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | multipart/form-data | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
| jwkFile | file | Yes | The JWK or JWK Set JSON document |
| jwkName | string | Yes | Name of the JWK to create |
| kid | string | Yes | Key ID of the key to load from the document |
| jwkDescription | string | No | Description |
Response
Success Response (200 OK)
{
"status": "SUCCESS"
}
When the JWK was stored but could not be deployed to its environments, the response says so:
{
"status": "SUCCESS",
"resultMessage": "JWK was saved successfully but deployment to environments failed. Details: ...",
"deploymentResult": {
"success": false,
"detailList": []
}
}
Error Response (400 Bad Request)
{
"status": "FAILURE",
"resultMessage": "JWK (name: signing-jwk) is already exist!"
}
or
{
"status": "FAILURE",
"resultMessage": "kid value can not be empty!"
}
or
{
"status": "FAILURE",
"resultMessage": "jwkFile value can not be empty!"
}
Common Causes
- A JWK of that name already exists in the project
kidis missing, or names a key the document does not contain- The uploaded file is not a valid JWK or JWK Set document
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
cURL Example
Example 1: Upload a JWK Set
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/jwks/import-file/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "jwkFile=@jwks.json" \
-F "jwkName=partner-jwk" \
-F "kid=partner-2026"
Example 2: Upload with a Description
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/jwks/import-file/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "jwkFile=@jwks.json" \
-F "jwkName=partner-jwk" \
-F "kid=partner-2026" \
-F "jwkDescription=Partner signing key, rotated 2026-01"
Notes and Warnings
kidselects the key: a JWK Set can carry several keys, so the key ID says which one is being registered. It is required even for a document holding a single key.- Same parsing as the clipboard endpoint: a file upload is only a different way in, never different semantics — the document is read exactly as Parse JWK from Clipboard reads it.
- Names are unique per project: importing onto an existing name is rejected rather than silently creating a second JWK. Delete or rename the existing one first.
- Public documents are fine: a JWK Set holding only public members registers normally, which is the usual shape when a partner sends you their keys.
Permissions
- User must have
SECRETS+EXPORT_IMPORTpermission in the project
Related Documentation
- Export JWK File - Download the raw JWK document
- Parse JWK from Clipboard - Supply the document as text
- Parse JWK from URL - Fetch the document from a JWKS URL