> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# serviceUserPublicKeyCreate

> Add a public key to a service account. Returns null if the caller has no service account with that id.

**Required scopes:** [`user_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-user_write)

## Arguments

**input** `[ServiceUserPublicKeyCreateInput!](/docs/api-reference/v3/reference/service-users/service-user-public-key-create-input)` *required*

**fields**

**jwk** `String!` *required*

The public key as a JSON Web Key: an EC, OKP or RSA public key, never a private one.

**name** `String!` *required*

A label that helps recognize the key.

**serviceUserId** `ID!` *required*

The id of the service account to add it to.

## Returns

**serviceUserPublicKeyCreate** `[ServiceUserPublicKey](/docs/api-reference/v3/reference/service-users/service-user-public-key)`

A public key that verifies the JWT assertions the caller signs with its private key.

**fields**

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the credential was created.

**fingerprint** `String!` *required*

The key's RFC 7638 SHA-256 JWK thumbprint, which an assertion names as its `kid`.

**id** `ID!` *required*

The id of this credential.

**lastUsedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the credential last authenticated, or null if it never has.

**name** `String!` *required*

A label that helps recognize the credential.

## Example

```graphql theme={null}
mutation {
  serviceUserPublicKeyCreate(input: { ... }, serviceUserId: "...") {
    createdAt
    fingerprint
    id
    lastUsedAt
    name
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.