> For the complete documentation index, see [llms.txt](https://docs.agant.io/Y83ivqmfOiUspagNyFg6/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agant.io/Y83ivqmfOiUspagNyFg6/api-reference/rail.md).

# Rail

## List Rails

> Retrieves a list of Rails.

```json
{"openapi":"3.1.0","info":{"title":"Agant API Docs","version":"0.0.2"},"servers":[{"url":"https://sandbox.agant.io/api/v1","description":"Sandbox"}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"RailResource":{"type":"object","properties":{"id":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/RailType"},"source":{"description":"When type is ON_RAMP: FiatAssetResource; OFF_RAMP: CryptoAssetResource","anyOf":[{"$ref":"#/components/schemas/FiatAssetResource"},{"$ref":"#/components/schemas/CryptoAssetResource"}]},"destination":{"description":"When type is ON_RAMP: CryptoAssetResource; OFF_RAMP: FiatAssetResource","anyOf":[{"$ref":"#/components/schemas/CryptoAssetResource"},{"$ref":"#/components/schemas/FiatAssetResource"}]},"metadata":{"type":"object","properties":{"external_id":{"type":["array","null"],"items":{}}},"required":["external_id"]},"human":{"type":"null"},"created_at":{"type":["string","null"],"format":"date-time"}},"required":["id","type","source","destination","metadata","created_at"],"title":"RailResource"},"RailType":{"type":"string","enum":["ON_RAMP","OFF_RAMP","EXCHANGE"],"title":"RailType"},"FiatAssetResource":{"type":"object","properties":{"asset":{"type":"string"},"type":{"type":"string"},"bank_account":{"$ref":"#/components/schemas/BankAccountResource"}},"required":["asset","type","bank_account"],"title":"FiatAssetResource"},"BankAccountResource":{"type":"object","properties":{"id":{"type":["string","null"]},"display_name":{"type":"string"},"currency":{"type":"string"},"iban":{"type":["string","null"]},"account_number":{"type":"string"},"sort_code":{"type":"string"},"bic_swift":{"type":"string"},"reference":{"type":["string","null"]}},"required":["id","display_name","currency","iban","reference"],"title":"BankAccountResource"},"CryptoAssetResource":{"type":"object","properties":{"asset":{"type":"string"},"type":{"type":"string"},"wallet":{"$ref":"#/components/schemas/WalletResource"}},"required":["asset","type","wallet"],"title":"CryptoAssetResource"},"WalletResource":{"type":"object","properties":{"id":{"type":["string","null"]},"display_name":{"type":"string"},"is_custodial":{"type":"boolean"},"network":{"type":"string"},"address":{"type":"string"}},"required":["id","display_name","is_custodial","network","address"],"title":"WalletResource"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}}}},"paths":{"/rails":{"get":{"operationId":"rail.index","description":"Retrieves a list of Rails.","summary":"List Rails","tags":["Rail"],"responses":{"200":{"description":"Paginated set of `RailResource`","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RailResource"}},"meta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":["integer","null"]},"last_page":{"type":"integer"},"links":{"type":"array","description":"Generated paginator links.","items":{"type":"object","properties":{"url":{"type":["string","null"]},"label":{"type":"string"},"active":{"type":"boolean"}},"required":["url","label","active"]}},"path":{"type":["string","null"],"description":"Base path for paginator generated URLs."},"per_page":{"type":"integer","description":"Number of items shown per page."},"to":{"type":["integer","null"],"description":"Number of the last item in the slice."},"total":{"type":"integer","description":"Total number of items being paginated."}},"required":["current_page","from","last_page","links","path","per_page","to","total"]},"links":{"type":"object","properties":{"first":{"type":["string","null"]},"last":{"type":["string","null"]},"prev":{"type":["string","null"]},"next":{"type":["string","null"]}},"required":["first","last","prev","next"]}},"required":["data","links","meta"]}}}},"401":{"$ref":"#/components/responses/AuthenticationException"}}}}}}
```

## Create Rail

> Create a new Rail for moving value between fiat and stablecoins.

```json
{"openapi":"3.1.0","info":{"title":"Agant API Docs","version":"0.0.2"},"servers":[{"url":"https://sandbox.agant.io/api/v1","description":"Sandbox"}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"StoreRailRequest":{"type":"object","properties":{"type":{"type":"string","description":"Type","enum":["ON_RAMP","OFF_RAMP"]},"metadata":{"type":["array","null"],"description":"Arbitrary metadata to associate with the rail.","items":{"type":"string"}},"source":{"type":"object","description":"The asset that will need to be sent to in order to trigger the rail.","properties":{"asset":{"type":"string"},"network_id":{"type":"string","description":"Network identifier. Required for OFF_RAMP."}},"required":["asset"]},"destination":{"type":"object","description":"Where the destination asset will be delivered after receiving from the source.","properties":{"asset":{"type":"string"},"wallet_id":{"type":"integer","description":"Destination wallet public id. Required for ON_RAMP"},"bank_account_id":{"type":"integer","description":"Destination bank account public id. Required for OFF_RAMP."}},"required":["asset"]}},"required":["type","source","destination"],"title":"StoreRailRequest"},"RailResource":{"type":"object","properties":{"id":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/RailType"},"source":{"description":"When type is ON_RAMP: FiatAssetResource; OFF_RAMP: CryptoAssetResource","anyOf":[{"$ref":"#/components/schemas/FiatAssetResource"},{"$ref":"#/components/schemas/CryptoAssetResource"}]},"destination":{"description":"When type is ON_RAMP: CryptoAssetResource; OFF_RAMP: FiatAssetResource","anyOf":[{"$ref":"#/components/schemas/CryptoAssetResource"},{"$ref":"#/components/schemas/FiatAssetResource"}]},"metadata":{"type":"object","properties":{"external_id":{"type":["array","null"],"items":{}}},"required":["external_id"]},"human":{"type":"null"},"created_at":{"type":["string","null"],"format":"date-time"}},"required":["id","type","source","destination","metadata","created_at"],"title":"RailResource"},"RailType":{"type":"string","enum":["ON_RAMP","OFF_RAMP","EXCHANGE"],"title":"RailType"},"FiatAssetResource":{"type":"object","properties":{"asset":{"type":"string"},"type":{"type":"string"},"bank_account":{"$ref":"#/components/schemas/BankAccountResource"}},"required":["asset","type","bank_account"],"title":"FiatAssetResource"},"BankAccountResource":{"type":"object","properties":{"id":{"type":["string","null"]},"display_name":{"type":"string"},"currency":{"type":"string"},"iban":{"type":["string","null"]},"account_number":{"type":"string"},"sort_code":{"type":"string"},"bic_swift":{"type":"string"},"reference":{"type":["string","null"]}},"required":["id","display_name","currency","iban","reference"],"title":"BankAccountResource"},"CryptoAssetResource":{"type":"object","properties":{"asset":{"type":"string"},"type":{"type":"string"},"wallet":{"$ref":"#/components/schemas/WalletResource"}},"required":["asset","type","wallet"],"title":"CryptoAssetResource"},"WalletResource":{"type":"object","properties":{"id":{"type":["string","null"]},"display_name":{"type":"string"},"is_custodial":{"type":"boolean"},"network":{"type":"string"},"address":{"type":"string"}},"required":["id","display_name","is_custodial","network","address"],"title":"WalletResource"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/rails":{"post":{"operationId":"rail.store","description":"Create a new Rail for moving value between fiat and stablecoins.","summary":"Create Rail","tags":["Rail"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreRailRequest"}}}},"responses":{"200":{"description":"`RailResource`","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RailResource"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/AuthenticationException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}}}
```

## Get Rail

> Retrieves a Rail.

```json
{"openapi":"3.1.0","info":{"title":"Agant API Docs","version":"0.0.2"},"servers":[{"url":"https://sandbox.agant.io/api/v1","description":"Sandbox"}],"security":[{"http":[]}],"components":{"securitySchemes":{"http":{"type":"http","scheme":"bearer"}},"schemas":{"RailResource":{"type":"object","properties":{"id":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/RailType"},"source":{"description":"When type is ON_RAMP: FiatAssetResource; OFF_RAMP: CryptoAssetResource","anyOf":[{"$ref":"#/components/schemas/FiatAssetResource"},{"$ref":"#/components/schemas/CryptoAssetResource"}]},"destination":{"description":"When type is ON_RAMP: CryptoAssetResource; OFF_RAMP: FiatAssetResource","anyOf":[{"$ref":"#/components/schemas/CryptoAssetResource"},{"$ref":"#/components/schemas/FiatAssetResource"}]},"metadata":{"type":"object","properties":{"external_id":{"type":["array","null"],"items":{}}},"required":["external_id"]},"human":{"type":"null"},"created_at":{"type":["string","null"],"format":"date-time"}},"required":["id","type","source","destination","metadata","created_at"],"title":"RailResource"},"RailType":{"type":"string","enum":["ON_RAMP","OFF_RAMP","EXCHANGE"],"title":"RailType"},"FiatAssetResource":{"type":"object","properties":{"asset":{"type":"string"},"type":{"type":"string"},"bank_account":{"$ref":"#/components/schemas/BankAccountResource"}},"required":["asset","type","bank_account"],"title":"FiatAssetResource"},"BankAccountResource":{"type":"object","properties":{"id":{"type":["string","null"]},"display_name":{"type":"string"},"currency":{"type":"string"},"iban":{"type":["string","null"]},"account_number":{"type":"string"},"sort_code":{"type":"string"},"bic_swift":{"type":"string"},"reference":{"type":["string","null"]}},"required":["id","display_name","currency","iban","reference"],"title":"BankAccountResource"},"CryptoAssetResource":{"type":"object","properties":{"asset":{"type":"string"},"type":{"type":"string"},"wallet":{"$ref":"#/components/schemas/WalletResource"}},"required":["asset","type","wallet"],"title":"CryptoAssetResource"},"WalletResource":{"type":"object","properties":{"id":{"type":["string","null"]},"display_name":{"type":"string"},"is_custodial":{"type":"boolean"},"network":{"type":"string"},"address":{"type":"string"}},"required":["id","display_name","is_custodial","network","address"],"title":"WalletResource"}},"responses":{"AuthenticationException":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ModelNotFoundException":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}}}},"paths":{"/rails/{rail}":{"get":{"operationId":"rail.show","description":"Retrieves a Rail.","summary":"Get Rail","tags":["Rail"],"parameters":[{"name":"rail","in":"path","required":true,"description":"The rail public id","schema":{"type":["string","null"]}}],"responses":{"200":{"description":"`RailResource`","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RailResource"}},"required":["data"]}}}},"401":{"$ref":"#/components/responses/AuthenticationException"},"404":{"$ref":"#/components/responses/ModelNotFoundException"}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.agant.io/Y83ivqmfOiUspagNyFg6/api-reference/rail.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
