# Ingest

## Endpoint

* **URL:** [**https://api.genlogs.io/image**](https://api.genlogs.io/image)
* **Method:** `POST`

### Request Headers

* `accept: application/json`
* `Content-Type: application/json`
* `x-api-key: your-api-key-here`
* `Authorization: Bearer your-access-token-here`

### Request Body Parameters

* **source** `(string, required)`: Sensor identifier we use for our partners
* **image\_url** `(string, URL, required)`: Image's URL to process
* **time\_captured** `(string, ISO 8601, required)`: Timestamp when image was captured
* **detection\_bounding\_box** `(Object, required)`: Coordinates of detection box
  * **xmin** `(float, required)`: Left coordinate
  * **ymin** `(float, required)`: Top coordinate
  * **xmax** `(float, required)`: Right coordinate
  * **ymax** `(float, required)`: Bottom coordinate
* **source\_location\_info** `(Object, required)`: Location information
  * **latitude** `(float, required)`: Location latitude
  * **longitude** `(float, required)`: Location longitude
  * **city** `(string, required)`: City name
  * **state** `(string, required)`: State name
  * **route** `(string, required)`: Route identifier
  * **traffic\_direction** (string, required): Traffic direction
* **detection\_metadata** `(Object, required)`: Detection metadata
  * **alpr\_confidence** `(float, required)`: Confidence score of ALPR detection
  * **alpr\_state** `(string, required)`: License plate's state
  * **plate\_number** `(string, optional)`: Detected plate number

### Error Response

* **200 OK:** A json object containing the `Image received` message.
* **401 Unauthorized**: If the authentication credentials (api-key or access-token) are missing or incorrect.
* **403 Forbidden:** If the `access-token` has expired or if the user don't have the required roles.
* **422 Unprocessable Entity:** If there are missing required fields, invalid field formats or empty values in required fields
* **500 Internal Server Errors:** If here are errors downloading the image, uploading the image to our DB, deleting the image from our servers or posting to our internal servers

## Request Example

```bash
curl -X 'POST' \
  'https://api.genlogs.io/image' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: your-api-key-here' \
  -H 'Authorization: Bearer your-access-token-here' \
  -d '{
  "source": "sensor_identifier",
  "image_url": "https://example.com/image.jpg",
  "time_captured": "2025-02-11T22:50:25.459Z",
  "detection_bounding_box": {
    "xmin": 200,
    "ymin": 200,
    "xmax": 400,
    "ymax": 400
  },
  "source_location_info": {
    "latitude": 34.2,
    "longitude": -118.5,
    "city": "Los Angeles",
    "state": "CA",
    "route": "US-101",
    "traffic_direction": "north"
  },
  "detection_metadata": {
    "alpr_confidence": 0.9,
    "alpr_state": "CA",
    "plate_number": "8XYZ012"
  }
}'
```

{% openapi src="/files/ROurc6ldSdoqtmwRU6lZ" path="/image" method="post" %}
[external\_ingest\_api\_open\_api.json](https://3870527242-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZBzLWqiZ4RlvAoJ0tXja%2Fuploads%2FO7jiyyIo07Slt3J4djME%2Fexternal_ingest_api_open_api.json?alt=media\&token=af9412a6-ee2b-4dd0-81ea-3af6ba877390)
{% endopenapi %}


---

# 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://partners.genlogs.io/images/ingest.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.
