> For the complete documentation index, see [llms.txt](https://api.dataloy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.dataloy.com/api-release-8.5/user-guides/schedule-api.md).

# Schedule API

Create a Voyage with a Loading and Discharging PortCall with one Cargo with a Loading and Discharging CargoPort.&#x20;

&#x20;

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><pre class="language-json"><code class="lang-json">POST /Voyage

{
"ballastPort":102546,
"vessel":1609791,
"cargos":\[
{
"cargoMeasurement":"MT",
"cargoType":"SPOT",
"cargoPorts":\[
{
"cargoPortSequence":1,
"port":105219,
"reasonForCall":"L"
},
{
"cargoPortSequence":1,
"port":101770,
"reasonForCall":"D"
}
]
}
],
"portCallsFromVoyage":\[
{
"port":105219,
"portCallSequence":1,
"reasonForCall":"L",
"currency":"EUR"
},
{
"port":101770,
"portCallSequence":2,
"reasonForCall":"D",
"currency":"EUR"
}
]
} </code></pre></td></tr></tbody></table>

Creating a new Cargo with a Loading and Discharging CargoPort and PortCall. The PortCall objects have EventLogDates that specify Arrival, Berthing, Un-berthing, and Departure dates.

```json
POST /Cargo
 
{
    "cargoMeasurement": "MT",
    "cargoPorts": [
        {
            "cargoPortSequence": 1,
            "cargoQuantity": 1234,
            "laytimeTermsMeasurement": "H",
            "port": {
                "key": 102381
            },
            "portCall": {
                "portCallSequence": 3,
                "reasonForCall": "L",
                "port": 102381,
                "voyage": 6136896
            },
            "reasonForCall": "L"
        },
        {
            "cargoPortSequence": 1,
            "cargoQuantity": 1234,
            "freightRate": 1210,
            "laytimeTermsMeasurement": "H",
            "port": {
                "key": 101486
            },
            "portCall": {
                "portCallSequence": 4,
                "reasonForCall": "D",
                "port": 101486,
                "voyage": 6136896
            },
            "reasonForCall": "D"
        }
    ],
    "charterer": {
        "key": 1004307
    },
    "commodity": {
        "key": 1675975
    },
    "freightCurrency": "USD",
    "voyage": {
        "key": 6136896
    }
}
```

Adding to a Cargo a new Loading or Discharging CargoPort and PortCall

```json
PUT /Cargo/{KEY}
 
{
    "cargoPorts": [
        {
            "key": 18739785
        },
        {
            "key": 18739786
        },
        {
            "port": 103991,
            "reasonForCall": "D",
            "cargoPortSequence": 2,
            "portCall": {
                "portCallSequence": 6,
                "reasonForCall": "D",
                "port": 103991,
                "voyage": 18739534,
                "ownedByVoyage": 18739534
            }
        }
    ]
}

```

Fixing the date on an EventLog object. Note, only EventLogs with EventLog.EventLogDate from the past can be fixed, otherwise, the returned value of isDateFixed will be *false*.

```json
PUT /EventLog/{KEY}

{
    "isDateFixed":true
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://api.dataloy.com/api-release-8.5/user-guides/schedule-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
