# \_setImage

Sets images for a company's profile.

### Parameters

#### name

Which type of image is being set.\
Must be one of the following:\
app-header\
app-icon\
letterhead\
logo-square

#### Filedata

A Base64 data-uri string of the image data.

### Example

Image used in this example is a 5x5 red dot, Filedata will usually have a much longer string for images.

```
FM_api(
    'Setting_setImage',[
      'name' => 'logo-square',
      'Filedata' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
    ]
);
```

### Results

#### On Success

The 'num' value and 'img' content values can vary.

Examples:

Img contents (user id, image type, image name) are included if the format is logo-square or letterhead.

```
{"ok":1,"num":2,"img":"92447\/logo-square\/2.png"}
```

```
{"ok":1,"num":1,"img":"92447\/letterhead\/1.png"}
```

If the type is 'app-icon' or 'app-header':

```
{"ok":1,"num":1}
```

#### On Failure

If there is no "name" parameter set

```
{"error":"missing parameter: name"}
```

If the "name" parameter does not match any of the formats

```
{"error":"invalid parameter: name"}
```

If there is no "Filedata" parameter set

```
{"error":"missing parameter: Filedata"}
```

If the "Filedata" string cannot be recognized as an image

```
{"error":"failed to convert image"}
```


---

# 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/setting/_setimage.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.
