# Creating & Uploading

This API endpoint allows you to create an image. To create an image, you must provide a valid API key.

{% hint style="info" %}
We've prepared quick start guides for uploading images the simplest way possible. If you're stuck, or perhaps want to see simple code examples, then start over there!

[single-bracket](https://docs.autoenhance.ai/getting-started/quickstart/single-bracket "mention")

[hdr](https://docs.autoenhance.ai/getting-started/quickstart/hdr "mention")
{% endhint %}

### Creating image

{% openapi src="<https://api.autoenhance.ai/docs/openapi.spec>" path="/v3/images/" method="post" expanded="false" %}
<https://api.autoenhance.ai/docs/openapi.spec>
{% endopenapi %}

{% hint style="info" %}
All of your uploaded images will contain an **order\_id** even if you don't specify it. If you want to upload multiple images into an order, you need to specify the **order\_id** while creating the image in our API. Learn more on the [Orders page](https://docs.autoenhance.ai/orders).
{% endhint %}

After successfully creating an image, the response will include an `upload_url` or  `s3PutObjectUrl` if you're using an older API version.  To upload the physical image to our service, make a PUT request to this URL with the image in the body of the request.

## Uploading image

<mark style="color:orange;">`PUT`</mark> **`upload_url || s3PutObjectUrl`**

The body should contain the data for your image and the Content-Type should be equal to what you sent when creating the image.

**Headers**

| Name         | Value                                                                                                                                                                                                                                                                   |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Content-Type | <p>eg. <code>image/jpeg</code> This value has to match the used <code>content\_type</code> in create image request!<br><br>If you don't specify content\_type in the create image request please specify <code>application/octet-stream</code> for the header value</p> |

**Body**

| Type         | Description                     |
| ------------ | ------------------------------- |
| File or Blob | Image in a Blob or File format. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "status": "success"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}
