> ## 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.

# serviceUserFederatedPolicyCreate

> Add a federated policy 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** `[ServiceUserFederatedPolicyCreateInput!](/docs/api-reference/v3/reference/service-users/service-user-federated-policy-create-input)` *required*

**fields**

**conditions** `[\[ServiceUserClaimConditionInput!\]!](/docs/api-reference/v3/reference/service-users/service-user-claim-condition-input)` *required*

Conditions on the token's claims; at least one. Every one must match. A pattern on `/sub` must name the subject before any `*`.

**fields**

**claim** `String!` *required*

A JSON Pointer into the token's claims, such as "/sub".

**pattern** `String!` *required*

The value the claim must match. `*` matches any characters.

**issuer** `String!` *required*

The HTTPS URL of the OpenID Connect issuer whose tokens the policy trusts.

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

A label that helps recognize the policy.

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

The id of the service account to add it to.

## Returns

**serviceUserFederatedPolicyCreate** `[ServiceUserFederatedPolicy](/docs/api-reference/v3/reference/service-users/service-user-federated-policy)`

Trusts OpenID Connect tokens from an external issuer, such as a CI provider, whose claims meet every condition.

**fields**

**conditions** `[\[ServiceUserClaimCondition!\]!](/docs/api-reference/v3/reference/service-users/service-user-claim-condition)` *required*

Conditions on the token's claims. Every one must match.

**fields**

**claim** `String!` *required*

A JSON Pointer into the token's claims, such as "/sub".

**pattern** `String!` *required*

The value the claim must match. `*` matches any characters.

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

When the credential was created.

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

The id of this credential.

**issuer** `String!` *required*

The issuer whose tokens the policy trusts.

**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 {
  serviceUserFederatedPolicyCreate(input: { ... }, serviceUserId: "...") {
    createdAt
    id
    issuer
    lastUsedAt
    name
  }
}
```


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