Source: https://atomic-works-test.docs-staging.pageloop.ai/api-reference/sprinto-cookbooks/mark-staff-member-account-not-in-scope

# Mark Staff Member Account Not In Scope

---
description: >-
  Use the Sprinto Developer API to mark a staff member as not-in-scope and
  exclude them from audit and compliance checks.
---

# Mark staff member account Not-In-Scope

This cookbook explains how to mark a staff member account as **not-in-scope** using the Sprinto Developer API.

When staff accounts are added to Sprinto through HRMS or email provider integrations, they are included in the audit scope by default. Marking a staff member as not-in-scope excludes them from compliance activities such as policy acknowledgements, training assignments, and automated checks.

This operation is performed using a GraphQL **mutation**.

***

### Before you begin

Ensure that you have:

* A valid **API key**
* Access to the Sprinto API Playground (if using the playground)
* The **email address** of the staff member to mark as not-in-scope

If the provided email address is invalid or does not belong to an active staff member, the API returns an error.

***

### API status

The Sprinto Developer API is currently in beta.

* Endpoints and schema fields may change as new functionality is introduced.

***

### Mutation: `markStaffAsNotInScope`

This mutation marks a staff member as not-in-scope using their email address. You can optionally provide a reason for auditing or tracking purposes.

#### Input arguments

<table><thead><tr><th width="120.25">Argument</th><th width="92.19921875">Type</th><th width="111.3515625">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>email</code></td><td>String</td><td>Yes</td><td>Email address of the staff member to mark as not-in-scope</td></tr><tr><td><code>reason</code></td><td>String</td><td>No</td><td>Optional reason for marking the staff member as not-in-scope</td></tr></tbody></table>

***

### Example mutation

{% tabs %}
{% tab title="Query" %}
```graphql
mutation MarkStaffAsNotInScope($email: String!, $reason: String) {
  markStaffAsNotInScope(email: $email, reason: $reason) {
    user {
      fullName
    }
  }
}
```
{% endtab %}

{% tab title="Response" %}
```python
{
  "email": "example@abc.com",
  "reason": "Testing the API call"
}
```
{% endtab %}
{% endtabs %}

**Try yourself**: [United States](https://app.sprinto.com/dev-api/explorer): [Europe](https://eu.sprinto.com/dev-api/explorer): [India](https://in.sprinto.com/dev-api/explorer)

***

### How the mutation works

* The request starts with the `Mutation` root type.
* The `markStaffAsNotInScope` mutation identifies the staff member using the `email` argument.
* The optional `reason` argument records why the staff member is excluded from scope.
* On success, the API returns the updated `user` object.

***

### Response fields

You can request the following fields from the returned `user` object:

<table><thead><tr><th width="132.69140625">Field</th><th width="121.3671875">Type</th><th width="315.33984375">Description</th></tr></thead><tbody><tr><td><code>firstName</code></td><td>String</td><td>First name of the staff member</td></tr><tr><td><code>lastName</code></td><td>String</td><td>Last name of the staff member</td></tr><tr><td><code>fullName</code></td><td>String</td><td>Full name of the staff member</td></tr><tr><td><code>email</code></td><td>String</td><td>Email address of the staff member</td></tr></tbody></table>

***

### Response codes and errors

The following response codes may be returned for this mutation:

<table><thead><tr><th width="130.42578125">Status code</th><th width="127.58203125">Status</th><th>Message</th><th>Reason</th></tr></thead><tbody><tr><td>200</td><td>Success</td><td>The account is marked as not-in-scope.</td><td>The staff member was successfully updated.</td></tr><tr><td>200</td><td>Error</td><td>Invalid email address or a non-staff account.</td><td>The email does not belong to a valid staff account or is marked as non-staff.</td></tr><tr><td>200</td><td>Error</td><td>The email was assigned to an offboarded staff member.</td><td>Offboarded staff members cannot be marked as not-in-scope.</td></tr><tr><td>401</td><td>Unauthorized</td><td>Invalid or expired API token.</td><td>The API key is invalid or disabled.</td></tr><tr><td>429</td><td>Too many requests</td><td>Too many requests. Please try again later.</td><td>The API rate limit has been exceeded.</td></tr></tbody></table>

***

### Next steps

After marking a staff member as not-in-scope, you can:

* Review in-scope and not-in-scope staff using paginated queries
* Re-include staff members by marking them **in-scope**
* Automate staff scoping as part of onboarding and offboarding workflows
