# \_setStatus

Sets the status of a link request.

### Parameters

#### id

The ID of the link request.

#### status

An integer representing the status: 0 for Pending, 1 for Accepted and 2 for Denied.

### Example

```
FM_api('Outsourcing_requestLink', ['id' => '1', 'status' => '1']);
```

### Result

#### On Success

```
{'ok':1}
```

#### On Failure

If the user is not logged in: {'error':'not logged in'}

If no link request ID is supplied: {'error':'no ID'}

If no status integer is supplied: {'error':'no status'}

If a link request does not exist or does not connect to your FieldMotion account: {'error':'link does not exist, or is not your link'}

If a link request already has the supplied status: {'error':'link already has that status'}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/outsourcing/_setstatus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
