Create project policy credential
POST
/api/v1/projects/{projectId}/policies/{projectPolicyId}/credentials
const
url
=
'
https://localhost:10001/api/v1/projects/1/policies/1/credentials
'
;
const
options
= {
method:
'
POST
'
,
headers: {Authorization:
'
'
,
'
Content-Type
'
:
'
application/json
'
},
body:
'
{"expiresAt":"example"}
'
}
;
try
{
const
response
= await
fetch
(url
,
options);
const
data
= await
response
.
json
();
console
.
log
(data);
}
catch
(error) {
console
.
error
(error);
}
curl
--request
POST
\
--url
https://localhost:10001/api/v1/projects/1/policies/1/credentials
\
--header
'
Authorization:
'
\
--header
'
Content-Type: application/json
'
\
--data
'
{ "expiresAt": "example" }
'
Issue a new credential for a project policy and return the persisted record
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”
projectId
required
integer
Project ID
projectPolicyId
required
integer
Project Policy ID
Request Body
Section titled “Request Body ”Project policy credential issuance request
Media type
application/json
object
expiresAt
string
Example generated
{
"expiresAt"
:
"
example
"
}
Responses
Section titled “ Responses ”Created credential
Media type
application/json
object
credential
object
credentialId
string
expiresAt
string
id
integer
issuedAt
string
issuedBy
string
projectPolicyId
integer
revoked
boolean
revokedAt
string
revokedBy
string
revokedReason
string
sourceCid
string
Example generated
{
"credential"
: {},
"credentialId"
:
"
example
"
,
"expiresAt"
:
"
example
"
,
"id"
:
1
,
"issuedAt"
:
"
example
"
,
"issuedBy"
:
"
example
"
,
"projectPolicyId"
:
1
,
"revoked"
:
true
,
"revokedAt"
:
"
example
"
,
"revokedBy"
:
"
example
"
,
"revokedReason"
:
"
example
"
,
"sourceCid"
:
"
example
"
}
Bad request - Invalid IDs or request body
Media type
application/json
object
key
additional properties
string
Example generated
{
"additionalProperty"
:
"
example
"
}
Unauthorized - Authentication required
Media type
application/json
object
key
additional properties
string
Example generated
{
"additionalProperty"
:
"
example
"
}
Forbidden - No project access or insufficient permissions
Media type
application/json
object
key
additional properties
string
Example generated
{
"additionalProperty"
:
"
example
"
}
Internal server error
Media type
application/json
object
key
additional properties
string
Example generated
{
"additionalProperty"
:
"
example
"
}