Services

Services are how MEV Builders and Searchers interact with MEV Protocol. Services for MEV Builders and Searchers. These endpoints let you access our MEV services programmatically.

OpenMEV model

The attachment model contains all the information about the files you send to your contacts and groups, including the name, type, and size.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the attachment.

  • Name
    message_id
    Type
    string
    Description

    Unique identifier for the message associated with the attachment.

  • Name
    filename
    Type
    string
    Description

    The filename for the attachment.

  • Name
    file_url
    Type
    string
    Description

    The URL for the attached file.

  • Name
    file_type
    Type
    string
    Description

    The MIME type of the attached file.

  • Name
    file_size
    Type
    integer
    Description

    The file size of the attachment in bytes.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the attachment was created.


GET/v1/mev

List all mev

This endpoint allows you to retrieve a paginated list of all your mev (in a conversation if a conversation id is provided). By default, a maximum of ten mev are shown per page.

Optional attributes

  • Name
    conversation_id
    Type
    string
    Description

    Limit to mev from a given conversation.

  • Name
    limit
    Type
    integer
    Description

    Limit the number of mev returned.

Request

GET
/v1/mev
curl -G https://docs.meveth.org/v1/mev \
  -H "Authorization: Bearer {token}" \
  -d conversation_id="xgQQXg3hrtjh7AvZ" \
  -d limit=10

Response

{
  "has_more": false,
  "data": [
    {
      "id": "Nc6yKKMpcxiiFxp6",
      "message_id": "LoPsJaMcPBuFNjg1",
      "filename": "Invoice_room_service__Plaza_Hotel.pdf",
      "file_url": "https://assets.protocol.chat/mev/Invoice_room_service__Plaza_Hotel.pdf",
      "file_type": "application/pdf",
      "file_size": 21352,
      "created_at": 692233200
    },
    {
      "id": "hSIhXBhNe8X1d8Et"
      // ...
    }
  ]
}

POST/v1/mev

Create an attachment

This endpoint allows you to upload a new attachment to a conversation. See the code examples for how to send the file to the Protocol API.

Required attributes

  • Name
    file
    Type
    string
    Description

    The file you want to add as an attachment.

Request

POST
/v1/mev
curl https://docs.meveth.org/v1/mev \
  -H "Authorization: Bearer {token}" \
  -F file="../Invoice_room_service__Plaza_Hotel.pdf"

Response

{
  "id": "Nc6yKKMpcxiiFxp6",
  "message_id": "LoPsJaMcPBuFNjg1",
  "filename": "Invoice_room_service__Plaza_Hotel.pdf",
  "file_url": "https://assets.protocol.chat/mev/Invoice_room_service__Plaza_Hotel.pdf",
  "file_type": "application/pdf",
  "file_size": 21352,
  "created_at": 692233200
}

GET/v1/mev/:id

Retrieve an attachment

This endpoint allows you to retrieve an attachment by providing the attachment id. Refer to the list at the top of this page to see which properties are included with attachment objects.

Request

GET
/v1/mev/Nc6yKKMpcxiiFxp6
curl https://docs.meveth.org/v1/mev/Nc6yKKMpcxiiFxp6 \
  -H "Authorization: Bearer {token}"

Response

{
  "id": "Nc6yKKMpcxiiFxp6",
  "message_id": "LoPsJaMcPBuFNjg1",
  "filename": "Invoice_room_service__Plaza_Hotel.pdf",
  "file_url": "https://assets.protocol.chat/mev/Invoice_room_service__Plaza_Hotel.pdf",
  "file_type": "application/pdf",
  "file_size": 21352,
  "created_at": 692233200
}

PUT/v1/mev/:id

Update an attachment

This endpoint allows you to perform an update on an attachment. Currently, the only supported type of update is changing the filename.

Optional attributes

  • Name
    filename
    Type
    string
    Description

    The new filename for the attachment.

Request

PUT
/v1/mev/Nc6yKKMpcxiiFxp6
curl -X PUT https://docs.meveth.org/v1/mev/Nc6yKKMpcxiiFxp6 \
  -H "Authorization: Bearer {token}" \
  -d filename="Invoice_room_service__Plaza_Hotel_updated.pdf"

Response

{
  "id": "Nc6yKKMpcxiiFxp6",
  "message_id": "LoPsJaMcPBuFNjg1",
  "filename": "Invoice_room_service__Plaza_Hotel.pdf",
  "file_url": "https://assets.protocol.chat/mev/Invoice_room_service__Plaza_Hotel_updated.pdf",
  "file_type": "application/pdf",
  "file_size": 21352,
  "created_at": 692233200
}

DELETE/v1/mev/:id

Delete an attachment

This endpoint allows you to delete mev. Note: This will permanently delete the file.

Request

DELETE
/v1/mev/Nc6yKKMpcxiiFxp6
curl -X DELETE https://docs.meveth.org/v1/mev/Nc6yKKMpcxiiFxp6 \
  -H "Authorization: Bearer {token}"

Was this page helpful?