{
    "openapi": "3.0.0",
    "info": {
        "title": "Callbacks API",
        "description": "Send phone numbers",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://callhuman.fr",
            "description": "Production"
        },
        {
            "url": "https://mondok.webbel.fr",
            "description": "Recette"
        }
    ],
    "paths": {
        "/api/callback": {
            "get": {
                "tags": [
                    "Callback"
                ],
                "summary": "Retrieve converted phone numbers",
                "operationId": "3a4d6715a33fb781cc0b48555d8b19ee",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "description": "The start date used for the phone number search. Format YYYY-MM-DD.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "description": "The end date used for the phone number search. Format YYYY-MM-DD.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "callbacks": {
                                            "description": "converted phone numbers",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "phone": {
                                                        "type": "string",
                                                        "example": "0123456789"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "example": "2024-04-26T10:18:32.000000Z"
                                                    }
                                                },
                                                "type": "object"
                                            },
                                            "collectionFormat": "multi"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone numbers have been successfully retrieved"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "result": {
                                            "type": "string",
                                            "example": "No converted phone numbers was found"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                }
            },
            "post": {
                "tags": [
                    "Callback"
                ],
                "summary": "Store new phone number",
                "description": "Returns phone number data",
                "operationId": "cc48cf6e83ba53718a0c1dc057672e05",
                "parameters": [
                    {
                        "name": "phone",
                        "in": "query",
                        "description": "The phone number to enter, with no space or '+33'. Example: 0123456789",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lastname",
                        "in": "query",
                        "description": "The last name of the phone number's owner.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "firstname",
                        "in": "query",
                        "description": "The first name of the phone number's owner.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "description": "The source where the request comes from.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cid",
                        "in": "query",
                        "description": "Optional, if sent by request.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "aid",
                        "in": "query",
                        "description": "The Affiliate ID.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "description": "The stored phone number data",
                                            "properties": {
                                                "phone": {
                                                    "type": "string",
                                                    "example": "0123456789"
                                                },
                                                "lastname": {
                                                    "type": "string",
                                                    "example": "Doe"
                                                },
                                                "firstname": {
                                                    "type": "string",
                                                    "example": "John"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "example": "2024-04-16T11:42:11.000000Z"
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "example": "2024-04-16T11:42:11.000000Z"
                                                },
                                                "id": {
                                                    "type": "number",
                                                    "example": "1"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Phone number has been successfully stored"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "result": {
                                            "type": "string",
                                            "example": "No Data found (missing token)"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer"
            }
        }
    },
    "security": [
        {
            "bearerAuth": []
        }
    ]
}