Upload API

Adding images to your datasets via the web UI is usually preferred because it is most fully featured and you can import and validate annotations from other tools. But it can also be useful to use our API to collect real world images directly from your application to improve your model.

post
Upload Image

https://api.roboflow.com/dataset/:url/upload
Note: be sure to obtain your API key from your Roboflow account here: https://app.roboflow.com/account/api
Request
Response
Request
Path Parameters
url
required
string
This is the url-safe version of the dataset name. You can find it in the web UI by looking at the URL when on the main dataset view. Example: chess-sample-xyz
Query Parameters
api_key
required
string
Obtain your API Key from the Roboflow API section of your account page.
image
optional
string
URL of the image to add. Use if your image is hosted elsewhere. (Required when you don't POST a base64 encoded image in the request body.)
name
optional
string
The filename of the image (if not set, we will try to infer it).
split
optional
string
One of: train, valid, or test (defaults to train).
Body Parameters
body
optional
string
A base64 encoded image. (Required when you don't pass an image URL in the query parameters.)
Response
200: OK
Image successfully uploaded.
{ "success": true }
401: Unauthorized
If you don't pass an API key, don't specify a valid dataset, or don't have permission to access the dataset you specified.
{
"error": {
"message": "Unsupported get request. Dataset with ID {{url}} does not exist or cannot be loaded due to missing permissions.",
"type": "GraphMethodException",
"hint": "You can see your available datasets by issuing a GET request to /datasets"
}
}